Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
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 55 of file orbit_view_controller.cpp.

Definition at line 65 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:
positionPosition to calculate the pitch/yaw for

Definition at line 259 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 290 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.

Reimplemented from rviz::ViewController.

Reimplemented in rviz::XYOrbitViewController.

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

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

Definition at line 284 of file orbit_view_controller.cpp.

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

Definition at line 204 of file orbit_view_controller.cpp.

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

Definition at line 216 of file orbit_view_controller.cpp.

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

Implements rviz::ViewController.

Reimplemented in rviz::XYOrbitViewController.

Definition at line 158 of file orbit_view_controller.cpp.

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

Implements rviz::ViewController.

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

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

Reimplemented from rviz::ViewController.

Definition at line 185 of file orbit_view_controller.cpp.

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

Definition at line 251 of file orbit_view_controller.cpp.

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 70 of file orbit_view_controller.cpp.

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

Return internal state as a string.

Implements rviz::ViewController.

Definition at line 303 of file orbit_view_controller.cpp.

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

Reimplemented in rviz::XYOrbitViewController.

Definition at line 226 of file orbit_view_controller.cpp.

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

Definition at line 243 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:
amountThe distance to move. Positive amount moves towards the focal point, negative moves away

Definition at line 273 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:


rviz
Author(s): Dave Hershberger, Josh Faust
autogenerated on Mon Jan 6 2014 11:54:33