Orbit view controller. More...
#include <OrbitViewController.hh>
Inherits ViewController.
Inherited by OrthoViewController.
Public Member Functions | |
OrbitViewController (UserCameraPtr _camera, const std::string &_name="OrbitViewController") | |
Constructor. More... | |
virtual | ~OrbitViewController () |
Destructor. More... | |
math::Vector3 | GetFocalPoint () const |
Get the focal point. More... | |
std::string | GetTypeString () const |
Get the type of view controller. More... | |
virtual void | HandleKeyPressEvent (const std::string &_key) |
Handle a key press event. More... | |
void | HandleKeyReleaseEvent (const std::string &_key) |
Handle a key release event. More... | |
virtual void | HandleMouseEvent (const common::MouseEvent &_event) |
Handle a mouse event. More... | |
virtual void | Init () |
Initialize the controller. More... | |
virtual void | Init (const math::Vector3 &_focalPoint, const double _yaw=0, const double _pitch=0) |
Initialize with a focus point. More... | |
double | Pitch () const |
virtual void | Resize (const unsigned int _width, const unsigned int _height) |
Called by the UserCamera when a resize event occurs. More... | |
void | SetDistance (float _d) |
Set the distance to the focal point. More... | |
void | SetEnabled (bool _value) |
Set whether the controller is enabled. More... | |
void | SetFocalPoint (const math::Vector3 &_fp) |
Set the focal point. More... | |
virtual void | Update () |
Update. More... | |
double | Yaw () const |
Static Public Member Functions | |
static std::string | GetTypeString () |
Get the type name of this view controller. More... | |
Protected Member Functions | |
double | NormalizePitch (double _v) |
Normalize pitch value. More... | |
double | NormalizeYaw (double _v) |
Normalize yaw value. More... | |
void | Orbit (double _dy, double _dp) |
Update the camera's pose based on a rotation update. More... | |
void | TranslateGlobal (const math::Vector3 &_vec) |
Translate the focal point in the global coordinate frame. More... | |
void | TranslateLocal (const math::Vector3 &_vec) |
Translate the focal point in the local coordinate frame. More... | |
void | UpdateRefVisual () |
Update the reference visual. More... | |
void | Zoom (float _amount) |
Zoom the camera. More... | |
Protected Attributes | |
UserCameraPtr | camera |
Pointer to the camera to control. More... | |
float | distance |
Distance to the focal point. More... | |
bool | enabled |
True if enabled. More... | |
ignition::math::Vector3d | focalPoint |
The focal point. More... | |
bool | init |
A flag used to inidicate that the view controller has just been initialized. More... | |
std::string | key |
Key that is currently pressed. More... | |
float | pitch |
Pitch value. More... | |
VisualPtr | refVisual |
A reference visual. More... | |
std::string | typeString |
Type of view controller. More... | |
float | yaw |
Yaw value. More... | |
Orbit view controller.
OrbitViewController | ( | UserCameraPtr | _camera, |
const std::string & | _name = "OrbitViewController" |
||
) |
Constructor.
[in] | _camera | Pointer to the camera to control. |
[in] | _name | Name of the view controller. A subclass of OrbitViewController should use a name other than "OrbitViewController". |
|
virtual |
Destructor.
math::Vector3 GetFocalPoint | ( | ) | const |
Get the focal point.
|
static |
Get the type name of this view controller.
|
inherited |
Get the type of view controller.
|
virtual |
|
virtual |
Handle a key release event.
[in] | _key | The key that was released. |
Implements ViewController.
|
virtual |
Handle a mouse event.
[in] | _event | The mouse event. |
Implements ViewController.
Reimplemented in OrthoViewController.
|
virtual |
|
virtual |
Initialize with a focus point.
[in] | _focalPoint | The point to look at. |
[in] | _yaw | Initial yaw angle. |
[in] | _pitch | Initial pitch angle. |
Reimplemented from ViewController.
Reimplemented in OrthoViewController.
|
protected |
Normalize pitch value.
[in] _v Normalize a pitch value.
|
protected |
Normalize yaw value.
[in] _v Normalize a yaw value.
|
protected |
Update the camera's pose based on a rotation update.
[in] | _dy | Delta yaw movement. |
[in] | _dp | Delta pitch movement. |
double Pitch | ( | ) | const |
|
virtualinherited |
Called by the UserCamera when a resize event occurs.
[in] | _width | New width |
[in] | _height | New height |
Reimplemented in OrthoViewController.
void SetDistance | ( | float | _d | ) |
Set the distance to the focal point.
[in] | _d | The distance from the focal point. |
|
inherited |
Set whether the controller is enabled.
[in] | _value | True if the controller is enabled. |
void SetFocalPoint | ( | const math::Vector3 & | _fp | ) |
Set the focal point.
[in] | _fp | The focal point |
|
protected |
Translate the focal point in the global coordinate frame.
[in] | _vec | Direction and amount to translate the camera. |
|
protected |
Translate the focal point in the local coordinate frame.
[in] | _vec | Direction and amount to translate the camera. |
|
virtual |
Update.
Implements ViewController.
|
protected |
Update the reference visual.
double Yaw | ( | ) | const |
|
protected |
Zoom the camera.
[in] _amount Zoom quatity.
|
protectedinherited |
Pointer to the camera to control.
|
protected |
Distance to the focal point.
|
protectedinherited |
True if enabled.
|
protected |
The focal point.
|
protected |
A flag used to inidicate that the view controller has just been initialized.
|
protected |
Key that is currently pressed.
|
protected |
Pitch value.
|
protected |
A reference visual.
|
protectedinherited |
Type of view controller.
|
protected |
Yaw value.