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 math::Vector3 &_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()

Constructor.

Parameters
[in]Camerato controll

§ ~FPSViewController()

virtual ~FPSViewController ( )
virtual

Destructor.

Member Function Documentation

§ GetTypeString() [1/2]

static std::string GetTypeString ( )
static

Get the type name of this view controller.

Returns
The name of the controller type: "fps"

§ GetTypeString() [2/2]

std::string GetTypeString ( ) const
inherited

Get the type of view controller.

Returns
The view controller type string.

§ HandleKeyPressEvent()

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

Handle a key press event.

Parameters
[in]_keyThe key that was pressed.

Implements ViewController.

§ HandleKeyReleaseEvent()

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

Handle a key release event.

Parameters
[in]_keyThe key that was released.

Implements ViewController.

§ HandleMouseEvent()

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

Handle a mouse event.

Parameters
[in]_eventThe mouse position.

Implements ViewController.

§ Init() [1/2]

virtual void Init ( )
virtual

Initialize the controller.

Implements ViewController.

§ Init() [2/2]

virtual void Init ( const math::Vector3 _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.

§ Resize()

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.

§ SetEnabled()

void SetEnabled ( bool  _value)
inherited

Set whether the controller is enabled.

Parameters
[in]_valueTrue if the controller is enabled.

§ Update()

virtual void Update ( )
virtual

Update the camera position.

Implements ViewController.

Member Data Documentation

§ camera

UserCameraPtr camera
protectedinherited

Pointer to the camera to control.

§ enabled

bool enabled
protectedinherited

True if enabled.

§ typeString

std::string typeString
protectedinherited

Type of view controller.


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