FPSViewController Class Reference

First Person Shooter style view controller. More...

#include <rendering/rendering.hh>

Inherits ViewController.

Public Member Functions

 FPSViewController (UserCameraPtr _camera)
 Constructor. More...
 
virtual ~FPSViewController ()
 Destructor. More...
 
std::string GetTypeString () const
 Get the type of view controller. More...
 
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 ignition::math::Vector3d &_focalPoint, const double _yaw=0, const double _pitch=0)
 Initialize with a focus point. More...
 
virtual void Resize (const unsigned int _width, const unsigned int _height)
 Called by the UserCamera when a resize event occurs. More...
 
void SetEnabled (bool _value)
 Set whether the controller is enabled. More...
 
virtual void Update ()
 Update the camera position. More...
 

Static Public Member Functions

static std::string GetTypeString ()
 Get the type name of this view controller. More...
 

Protected Attributes

UserCameraPtr camera
 Pointer to the camera to control. More...
 
bool enabled
 True if enabled. More...
 
std::string typeString
 Type of view controller. More...
 

Detailed Description

First Person Shooter style view controller.

Constructor & Destructor Documentation

FPSViewController ( UserCameraPtr  _camera)
explicit

Constructor.

Parameters
[in]Camerato controll
virtual ~FPSViewController ( )
virtual

Destructor.

Member Function Documentation

static std::string GetTypeString ( )
static

Get the type name of this view controller.

Returns
The name of the controller type: "fps"
std::string GetTypeString ( ) const
inherited

Get the type of view controller.

Returns
The view controller type string.
void HandleKeyPressEvent ( const std::string &  _key)
virtual

Handle a key press event.

Parameters
[in]_keyThe key that was pressed.

Implements ViewController.

void HandleKeyReleaseEvent ( const std::string &  _key)
virtual

Handle a key release event.

Parameters
[in]_keyThe key that was released.

Implements ViewController.

virtual void HandleMouseEvent ( const common::MouseEvent _event)
virtual

Handle a mouse event.

Parameters
[in]_eventThe mouse position.

Implements ViewController.

virtual void Init ( )
virtual

Initialize the controller.

Implements ViewController.

virtual void Init ( const ignition::math::Vector3d &  _focalPoint,
const double  _yaw = 0,
const double  _pitch = 0 
)
virtualinherited

Initialize with a focus point.

Parameters
[in]_focalPointThe point to look at.
[in]_yawInitial yaw angle.
[in]_pitchInitial pitch angle.

Reimplemented in OrbitViewController, and OrthoViewController.

virtual void Resize ( const unsigned int  _width,
const unsigned int  _height 
)
virtualinherited

Called by the UserCamera when a resize event occurs.

Parameters
[in]_widthNew width
[in]_heightNew height

Reimplemented in OrthoViewController.

void SetEnabled ( bool  _value)
inherited

Set whether the controller is enabled.

Parameters
[in]_valueTrue if the controller is enabled.
virtual void Update ( )
virtual

Update the camera position.

Implements ViewController.

Member Data Documentation

UserCameraPtr camera
protectedinherited

Pointer to the camera to control.

bool enabled
protectedinherited

True if enabled.

std::string typeString
protectedinherited

Type of view controller.


The documentation for this class was generated from the following file: