A first-person camera, controlled by yaw, pitch, and position. More...
#include <fps_view_controller.h>
Public Member Functions | |
FPSViewController () | |
virtual void | handleMouseEvent (ViewportMouseEvent &evt) |
virtual void | lookAt (const Ogre::Vector3 &point) |
This should be implemented in each subclass to aim the camera at the given point in space (relative to the fixed frame). | |
virtual void | mimic (ViewController *source_view) |
Configure the settings of this view controller to give, as much as possible, a similar view as that given by the source_view. | |
void | move (float x, float y, float z) |
virtual void | onInitialize () |
Do subclass-specific initialization. Called by ViewController::initialize after context_, target_scene_node_, and camera_ are set. This version calls updateTargetSceneNode(). | |
void | pitch (float angle) |
virtual void | reset () |
virtual void | update (float dt, float ros_dt) |
Called at 30Hz by ViewManager::update() while this view is active. Override with code that needs to run repeatedly. | |
void | yaw (float angle) |
virtual | ~FPSViewController () |
Protected Member Functions | |
Ogre::Quaternion | getOrientation () |
Return a Quaternion based on the yaw and pitch properties. | |
virtual void | onTargetFrameChanged (const Ogre::Vector3 &old_reference_position, const Ogre::Quaternion &old_reference_orientation) |
Override to implement the change in properties which nullifies the change in target frame. | |
void | setPropertiesFromCamera (Ogre::Camera *source_camera) |
void | updateCamera () |
Protected Attributes | |
FloatProperty * | pitch_property_ |
The camera's pitch (rotation around the x-axis), in radians. | |
VectorProperty * | position_property_ |
FloatProperty * | yaw_property_ |
The camera's yaw (rotation around the y-axis), in radians. |
A first-person camera, controlled by yaw, pitch, and position.
Definition at line 46 of file fps_view_controller.h.
Definition at line 57 of file fps_view_controller.cpp.
rviz::FPSViewController::~FPSViewController | ( | ) | [virtual] |
Definition at line 68 of file fps_view_controller.cpp.
Ogre::Quaternion rviz::FPSViewController::getOrientation | ( | ) | [protected] |
Return a Quaternion based on the yaw and pitch properties.
Definition at line 226 of file fps_view_controller.cpp.
void rviz::FPSViewController::handleMouseEvent | ( | ViewportMouseEvent & | evt | ) | [virtual] |
Reimplemented from rviz::ViewController.
Definition at line 93 of file fps_view_controller.cpp.
void rviz::FPSViewController::lookAt | ( | const Ogre::Vector3 & | point | ) | [virtual] |
This should be implemented in each subclass to aim the camera at the given point in space (relative to the fixed frame).
Reimplemented from rviz::ViewController.
Definition at line 199 of file fps_view_controller.cpp.
void rviz::FPSViewController::mimic | ( | ViewController * | source_view | ) | [virtual] |
Configure the settings of this view controller to give, as much as possible, a similar view as that given by the source_view.
source_view must return a valid Ogre::Camera*
from getCamera().
Reimplemented from rviz::FramePositionTrackingViewController.
Definition at line 187 of file fps_view_controller.cpp.
void rviz::FPSViewController::move | ( | float | x, |
float | y, | ||
float | z | ||
) |
Definition at line 236 of file fps_view_controller.cpp.
void rviz::FPSViewController::onInitialize | ( | ) | [virtual] |
Do subclass-specific initialization. Called by ViewController::initialize after context_, target_scene_node_, and camera_ are set. This version calls updateTargetSceneNode().
Reimplemented from rviz::FramePositionTrackingViewController.
Definition at line 72 of file fps_view_controller.cpp.
void rviz::FPSViewController::onTargetFrameChanged | ( | const Ogre::Vector3 & | old_reference_position, |
const Ogre::Quaternion & | old_reference_orientation | ||
) | [protected, virtual] |
Override to implement the change in properties which nullifies the change in target frame.
Reimplemented from rviz::FramePositionTrackingViewController.
Definition at line 205 of file fps_view_controller.cpp.
void rviz::FPSViewController::pitch | ( | float | angle | ) |
Definition at line 221 of file fps_view_controller.cpp.
void rviz::FPSViewController::reset | ( | ) | [virtual] |
Reset the view controller to some sane initial state, like looking at 0,0,0 from a few meters away.
Implements rviz::ViewController.
Definition at line 78 of file fps_view_controller.cpp.
void rviz::FPSViewController::setPropertiesFromCamera | ( | Ogre::Camera * | source_camera | ) | [protected] |
Definition at line 151 of file fps_view_controller.cpp.
void rviz::FPSViewController::update | ( | float | dt, |
float | ros_dt | ||
) | [virtual] |
Called at 30Hz by ViewManager::update() while this view is active. Override with code that needs to run repeatedly.
Reimplemented from rviz::FramePositionTrackingViewController.
Definition at line 193 of file fps_view_controller.cpp.
void rviz::FPSViewController::updateCamera | ( | ) | [protected] |
Definition at line 210 of file fps_view_controller.cpp.
void rviz::FPSViewController::yaw | ( | float | angle | ) |
Definition at line 216 of file fps_view_controller.cpp.
FloatProperty* rviz::FPSViewController::pitch_property_ [protected] |
The camera's pitch (rotation around the x-axis), in radians.
Definition at line 84 of file fps_view_controller.h.
Definition at line 85 of file fps_view_controller.h.
FloatProperty* rviz::FPSViewController::yaw_property_ [protected] |
The camera's yaw (rotation around the y-axis), in radians.
Definition at line 83 of file fps_view_controller.h.