$search

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 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)
void updateCamera ()

Protected Attributes

float distance_
 The camera's distance from the focal point.
Ogre::Vector3 focal_point_
 The camera's focal point.
ogre_tools::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 52 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 236 of file orbit_view_controller.cpp.

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

Implements rviz::ViewController.

Definition at line 271 of file orbit_view_controller.cpp.

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

Implements rviz::ViewController.

Definition at line 82 of file orbit_view_controller.h.

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

Definition at line 81 of file orbit_view_controller.h.

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

Reimplemented from rviz::ViewController.

Definition at line 57 of file orbit_view_controller.cpp.

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

Implements rviz::ViewController.

Definition at line 159 of file orbit_view_controller.cpp.

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

Definition at line 266 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 183 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 195 of file orbit_view_controller.cpp.

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

Implements rviz::ViewController.

Definition at line 127 of file orbit_view_controller.cpp.

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

Implements rviz::ViewController.

Definition at line 148 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 168 of file orbit_view_controller.cpp.

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

Reimplemented from rviz::ViewController.

Definition at line 154 of file orbit_view_controller.cpp.

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

Definition at line 229 of file orbit_view_controller.cpp.

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

Implements rviz::ViewController.

Definition at line 290 of file orbit_view_controller.cpp.

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

Definition at line 205 of file orbit_view_controller.cpp.

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

Definition at line 222 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 256 of file orbit_view_controller.cpp.


Member Data Documentation

The camera's distance from the focal point.

Definition at line 110 of file orbit_view_controller.h.

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

The camera's focal point.

Definition at line 107 of file orbit_view_controller.h.

Definition at line 111 of file orbit_view_controller.h.

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

Definition at line 109 of file orbit_view_controller.h.

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

Definition at line 108 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): Josh Faust, Dave Hershberger
autogenerated on Sat Mar 2 14:17:36 2013