rviz::OrbitViewController Class Reference

An orbital camera, controlled by yaw, pitch, distance, and focal point. More...

#include <orbit_view_controller.h>

Inheritance diagram for rviz::OrbitViewController:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual void fromString (const std::string &str)
virtual std::string getClassName ()
virtual void handleMouseEvent (ViewportMouseEvent &evt)
virtual void lookAt (const Ogre::Vector3 &point)
void move (float x, float y, float z)
 OrbitViewController (VisualizationManager *manager, const std::string &name, Ogre::SceneNode *target_scene_node)
void pitch (float angle)
virtual void reset ()
virtual std::string toString ()
void yaw (float angle)
void zoom (float amount)
 Move in/out from the focal point, ie. adjust distance_ by amount.
virtual ~OrbitViewController ()

Static Public Member Functions

static std::string getClassNameStatic ()

Protected Member Functions

void calculatePitchYawFromPosition (const Ogre::Vector3 &position)
 Calculates pitch and yaw values given a new position and the current focal point.
void normalizePitch ()
 Normalizes the camera's pitch, preventing it from reaching vertical (or turning upside down).
void normalizeYaw ()
 Normalizes the camera's yaw in the range [0, 2*pi).
virtual void onActivate ()
virtual void onDeactivate ()
virtual void onTargetFrameChanged (const Ogre::Vector3 &old_reference_position, const Ogre::Quaternion &old_reference_orientation)
virtual void onUpdate (float dt, float ros_dt)
virtual void updateCamera ()

Protected Attributes

float distance_
 The camera's distance from the focal point.
bool dragging_
Ogre::Vector3 focal_point_
 The camera's focal point.
Shapefocal_shape_
float pitch_
 The camera's pitch (rotation around the x-axis), in radians.
float yaw_
 The camera's yaw (rotation around the y-axis), in radians.

Detailed Description

An orbital camera, controlled by yaw, pitch, distance, and focal point.

This camera is based on the equation of a sphere in spherical coordinates:

 x = d*cos(theta)sin(phi)
 y = d*cos(phi)
 z = d*sin(theta)sin(phi)
 

Where:
d = distance_
theta = yaw_
phi = pitch_

Definition at line 60 of file orbit_view_controller.h.


Constructor & Destructor Documentation

rviz::OrbitViewController::OrbitViewController ( VisualizationManager manager,
const std::string &  name,
Ogre::SceneNode *  target_scene_node 
)

Definition at line 39 of file orbit_view_controller.cpp.

rviz::OrbitViewController::~OrbitViewController (  )  [virtual]

Definition at line 49 of file orbit_view_controller.cpp.


Member Function Documentation

void rviz::OrbitViewController::calculatePitchYawFromPosition ( const Ogre::Vector3 &  position  )  [protected]

Calculates pitch and yaw values given a new position and the current focal point.

Parameters:
position Position to calculate the pitch/yaw for

Definition at line 243 of file orbit_view_controller.cpp.

void rviz::OrbitViewController::fromString ( const std::string &  str  )  [virtual]

Set internal state from a string.

Implements rviz::ViewController.

Definition at line 274 of file orbit_view_controller.cpp.

virtual std::string rviz::OrbitViewController::getClassName (  )  [inline, virtual]

Implements rviz::ViewController.

Reimplemented in rviz::XYOrbitViewController.

Definition at line 82 of file orbit_view_controller.h.

static std::string rviz::OrbitViewController::getClassNameStatic (  )  [inline, static]

Reimplemented in rviz::XYOrbitViewController.

Definition at line 81 of file orbit_view_controller.h.

void rviz::OrbitViewController::handleMouseEvent ( ViewportMouseEvent evt  )  [virtual]

Reimplemented from rviz::ViewController.

Reimplemented in rviz::XYOrbitViewController.

Definition at line 64 of file orbit_view_controller.cpp.

void rviz::OrbitViewController::lookAt ( const Ogre::Vector3 &  point  )  [virtual]

Implements rviz::ViewController.

Reimplemented in rviz::XYOrbitViewController.

Definition at line 174 of file orbit_view_controller.cpp.

void rviz::OrbitViewController::move ( float  x,
float  y,
float  z 
)

Definition at line 268 of file orbit_view_controller.cpp.

void rviz::OrbitViewController::normalizePitch (  )  [protected]

Normalizes the camera's pitch, preventing it from reaching vertical (or turning upside down).

Definition at line 188 of file orbit_view_controller.cpp.

void rviz::OrbitViewController::normalizeYaw (  )  [protected]

Normalizes the camera's yaw in the range [0, 2*pi).

Definition at line 200 of file orbit_view_controller.cpp.

void rviz::OrbitViewController::onActivate (  )  [protected, virtual]

Implements rviz::ViewController.

Reimplemented in rviz::XYOrbitViewController.

Definition at line 142 of file orbit_view_controller.cpp.

void rviz::OrbitViewController::onDeactivate (  )  [protected, virtual]

Implements rviz::ViewController.

Definition at line 163 of file orbit_view_controller.cpp.

void rviz::OrbitViewController::onTargetFrameChanged ( const Ogre::Vector3 &  old_reference_position,
const Ogre::Quaternion &  old_reference_orientation 
) [protected, virtual]

Implements rviz::ViewController.

Definition at line 183 of file orbit_view_controller.cpp.

void rviz::OrbitViewController::onUpdate ( float  dt,
float  ros_dt 
) [protected, virtual]

Reimplemented from rviz::ViewController.

Definition at line 169 of file orbit_view_controller.cpp.

void rviz::OrbitViewController::pitch ( float  angle  ) 

Definition at line 235 of file orbit_view_controller.cpp.

void rviz::OrbitViewController::reset (  )  [virtual]

Reset the view controller to some sane initial state, like looking at 0,0,0 of the target frame.

Implements rviz::ViewController.

Definition at line 54 of file orbit_view_controller.cpp.

std::string rviz::OrbitViewController::toString (  )  [virtual]

Return internal state as a string.

Implements rviz::ViewController.

Definition at line 287 of file orbit_view_controller.cpp.

void rviz::OrbitViewController::updateCamera (  )  [protected, virtual]

Reimplemented in rviz::XYOrbitViewController.

Definition at line 210 of file orbit_view_controller.cpp.

void rviz::OrbitViewController::yaw ( float  angle  ) 

Definition at line 227 of file orbit_view_controller.cpp.

void rviz::OrbitViewController::zoom ( float  amount  ) 

Move in/out from the focal point, ie. adjust distance_ by amount.

Parameters:
amount The distance to move. Positive amount moves towards the focal point, negative moves away

Definition at line 257 of file orbit_view_controller.cpp.


Member Data Documentation

The camera's distance from the focal point.

Definition at line 111 of file orbit_view_controller.h.

Definition at line 113 of file orbit_view_controller.h.

Ogre::Vector3 rviz::OrbitViewController::focal_point_ [protected]

The camera's focal point.

Definition at line 108 of file orbit_view_controller.h.

Definition at line 112 of file orbit_view_controller.h.

The camera's pitch (rotation around the x-axis), in radians.

Definition at line 110 of file orbit_view_controller.h.

The camera's yaw (rotation around the y-axis), in radians.

Definition at line 109 of file orbit_view_controller.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines


rviz
Author(s): Dave Hershberger, Josh Faust
autogenerated on Wed Jun 6 11:25:48 2012