Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

oxygen::FPSController Class Reference

BodyController, that provides first person shooter (FPS) movement, i.e. More...

#include <fpscontroller.h>

Inheritance diagram for oxygen::FPSController:

Inheritance graph
[legend]
Collaboration diagram for oxygen::FPSController:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 FPSController ()
virtual ~FPSController ()
void AdjustHAngle (const float delta)
 adds a delta increment to the current horizontal angle
void AdjustVAngle (const float delta)
 adds a delta increment to the current vertical angle
void Forward (const bool state)
 enables or disables forward movement
void Backward (const bool state)
 enables or disables backwad movement
void StrafeLeft (const bool state)
 enables or disables left strafing
void StrafeRight (const bool state)
 enables or disables right strafing
void Up (const bool state)
 enables or disables up movement
void Down (const bool state)
 enables or disables down movement
void SetAcceleration (const float accel)
 sets the applied acceleration
float GetAcceleration () const
 returns the applied acceleration

Protected Member Functions

virtual void PrePhysicsUpdateInternal (float deltaTime)
 calculates and applies the force needed to perfom the activated movements

Protected Attributes

float mAcceleration
 the acceleration of the controller
float mHAngle
 the current horizontal angle
float mVAngle
 the current vertical angle
bool mForward
 event state 'forward'
bool mBackward
 event state 'backward'
bool mLeft
 event state 'left'
bool mRight
 event state 'right'
bool mUp
 event state 'up'
bool mDown
 event state 'down'

Detailed Description

BodyController, that provides first person shooter (FPS) movement, i.e.

moving forward, backward, strafing etc. The node maintains a state for each movement. This state can either be activated or deactivated with some accessor functions. As long as a state is activated the node performs the associated action during each time step.

Definition at line 37 of file fpscontroller.h.


Constructor & Destructor Documentation

FPSController::FPSController  ) 
 

Definition at line 29 of file fpscontroller.cpp.

References mAcceleration, mBackward, mDown, mForward, mHAngle, mLeft, mRight, mUp, and mVAngle.

FPSController::~FPSController  )  [virtual]
 

Definition at line 42 of file fpscontroller.cpp.


Member Function Documentation

void FPSController::AdjustHAngle const float  delta  ) 
 

adds a delta increment to the current horizontal angle

Definition at line 96 of file fpscontroller.cpp.

References mHAngle.

void FPSController::AdjustVAngle const float  delta  ) 
 

adds a delta increment to the current vertical angle

Definition at line 101 of file fpscontroller.cpp.

References mVAngle.

void FPSController::Backward const bool  state  ) 
 

enables or disables backwad movement

Definition at line 111 of file fpscontroller.cpp.

References mBackward.

void FPSController::Down const bool  state  ) 
 

enables or disables down movement

Definition at line 131 of file fpscontroller.cpp.

References mDown.

void FPSController::Forward const bool  state  ) 
 

enables or disables forward movement

Definition at line 106 of file fpscontroller.cpp.

References mForward.

float FPSController::GetAcceleration  )  const
 

returns the applied acceleration

Definition at line 141 of file fpscontroller.cpp.

References mAcceleration.

void FPSController::PrePhysicsUpdateInternal float  deltaTime  )  [protected, virtual]
 

calculates and applies the force needed to perfom the activated movements

Reimplemented from oxygen::BaseNode.

Definition at line 46 of file fpscontroller.cpp.

References salt::gDegToRad(), mAcceleration, mBackward, oxygen::BodyController::mBody, mDown, mForward, mHAngle, mLeft, mRight, mUp, mVAngle, salt::Matrix::Right(), salt::Matrix::RotateX(), salt::Matrix::RotationX(), salt::Matrix::RotationZ(), salt::TVector< DATATYPE, ELEMENTS, TYPE >::SquareLength(), salt::Matrix::Up(), salt::TVector3< DATATYPE, TYPE >::x(), salt::TVector3< DATATYPE, TYPE >::y(), and salt::TVector3< DATATYPE, TYPE >::z().

Here is the call graph for this function:

void FPSController::SetAcceleration const float  accel  ) 
 

sets the applied acceleration

Definition at line 136 of file fpscontroller.cpp.

References mAcceleration.

void FPSController::StrafeLeft const bool  state  ) 
 

enables or disables left strafing

Definition at line 116 of file fpscontroller.cpp.

References mLeft.

void FPSController::StrafeRight const bool  state  ) 
 

enables or disables right strafing

Definition at line 121 of file fpscontroller.cpp.

References mRight.

void FPSController::Up const bool  state  ) 
 

enables or disables up movement

Definition at line 126 of file fpscontroller.cpp.

References mUp.


Member Data Documentation

float oxygen::FPSController::mAcceleration [protected]
 

the acceleration of the controller

Definition at line 86 of file fpscontroller.h.

Referenced by FPSController(), GetAcceleration(), PrePhysicsUpdateInternal(), and SetAcceleration().

bool oxygen::FPSController::mBackward [protected]
 

event state 'backward'

Definition at line 100 of file fpscontroller.h.

Referenced by Backward(), FPSController(), and PrePhysicsUpdateInternal().

bool oxygen::FPSController::mDown [protected]
 

event state 'down'

Definition at line 112 of file fpscontroller.h.

Referenced by Down(), FPSController(), and PrePhysicsUpdateInternal().

bool oxygen::FPSController::mForward [protected]
 

event state 'forward'

Definition at line 97 of file fpscontroller.h.

Referenced by Forward(), FPSController(), and PrePhysicsUpdateInternal().

float oxygen::FPSController::mHAngle [protected]
 

the current horizontal angle

Definition at line 89 of file fpscontroller.h.

Referenced by AdjustHAngle(), FPSController(), and PrePhysicsUpdateInternal().

bool oxygen::FPSController::mLeft [protected]
 

event state 'left'

Definition at line 103 of file fpscontroller.h.

Referenced by FPSController(), PrePhysicsUpdateInternal(), and StrafeLeft().

bool oxygen::FPSController::mRight [protected]
 

event state 'right'

Definition at line 106 of file fpscontroller.h.

Referenced by FPSController(), PrePhysicsUpdateInternal(), and StrafeRight().

bool oxygen::FPSController::mUp [protected]
 

event state 'up'

Definition at line 109 of file fpscontroller.h.

Referenced by FPSController(), PrePhysicsUpdateInternal(), and Up().

float oxygen::FPSController::mVAngle [protected]
 

the current vertical angle

Definition at line 92 of file fpscontroller.h.

Referenced by AdjustVAngle(), FPSController(), and PrePhysicsUpdateInternal().


The documentation for this class was generated from the following files:
Generated on Thu Apr 6 15:47:05 2006 for rcssserver3d by  doxygen 1.4.4