Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

ONE::util::FPController Class Reference

Inheritance diagram for ONE::util::FPController:

Inheritance graph
[legend]
List of all members.

Detailed Description

Uses a First Person (Quake-style) mapping to translate keyboard and mouse input into a flying camera position. The result is an Euler-angle camera controller suitable for games and fly-throughs.


Public Types

enum  { FORWARD, BACKWARD }
 test actions More...
typedef ControlDispatcher Controller
 defines the Controller class
typedef ControllerCP
 pointer to Controller

Public Member Functions

virtual void act (const ActionControl &a)
bool active () const
void addController (const CP &)
 adds a controller
void clearControllers ()
 registers this from all controllers.
void doSimulation (double elapsedTime)
 FPController (class RenderDevice *, class UserInput *)
 FPController ()
void getCoordinateFrame (CoordinateFrame &c) const
CoordinateFrame getCoordinateFrame () const
Vector3 getLookVector () const
double getPitch () const
const Vector3 & getPosition () const
Vector3 getStrafeVector () const
double getYaw () const
void init (class RenderDevice *device, class UserInput *input)
void lookAt (const Vector3 &position)
virtual void processControlEvent (ControlEvent &e)
void removeController (const CP &)
 removes a controller
void reset ()
void setActive (bool a)
void setCoordinateFrame (const CoordinateFrame &c)
void setMoveRate (double metersPerSecond)
void setPosition (const Vector3 &t)
void setTurnRate (double radiansPerSecond)
void shareControllers (Controlled *peer)
 shares the Controller s controlling this object with peer
void transferControllers (Controlled *peer)
 transfers the Controller s controlling this object to peer
virtual ~FPController ()


Member Typedef Documentation

typedef ControlDispatcher ONE::util::Controlled::Controller [inherited]
 

defines the Controller class

typedef Controller* ONE::util::Controlled::CP [inherited]
 

pointer to Controller


Member Enumeration Documentation

anonymous enum
 

test actions

Todo:
move to some sensible permantent place
Enumerator:
FORWARD 
BACKWARD 


Constructor & Destructor Documentation

ONE::util::FPController::FPController  ) 
 

ONE::util::FPController::FPController class RenderDevice *  ,
class UserInput * 
 

Creates and initializes

virtual ONE::util::FPController::~FPController  )  [virtual]
 

Deactivates the controller


Member Function Documentation

virtual void ONE::util::FPController::act const ActionControl a  )  [inline, virtual]
 

bool ONE::util::FPController::active  )  const
 

void ONE::util::Controlled::addController const CP  )  [inherited]
 

adds a controller

This object is automatically registered with the controller.

void ONE::util::Controlled::clearControllers  )  [inherited]
 

registers this from all controllers.

void ONE::util::FPController::doSimulation double  elapsedTime  ) 
 

Increments the ManualCameraController's orientation and position. Invoke once per simulation step.

void ONE::util::FPController::getCoordinateFrame CoordinateFrame &  c  )  const
 

CoordinateFrame ONE::util::FPController::getCoordinateFrame  )  const
 

Vector3 ONE::util::FPController::getLookVector  )  const [inline]
 

double ONE::util::FPController::getPitch  )  const [inline]
 

const Vector3& ONE::util::FPController::getPosition  )  const [inline]
 

Vector3 ONE::util::FPController::getStrafeVector  )  const [inline]
 

Right vector

double ONE::util::FPController::getYaw  )  const [inline]
 

void ONE::util::FPController::init class RenderDevice *  device,
class UserInput *  input
 

You need to call setActive(true) before the controller will work.

void ONE::util::FPController::lookAt const Vector3 &  position  ) 
 

virtual void ONE::util::FPController::processControlEvent ControlEvent e  )  [inline, virtual]
 

Implements ONE::util::ControlListener.

void ONE::util::Controlled::removeController const CP  )  [inherited]
 

removes a controller

Tis object is automatically de-registered from the controller.

void ONE::util::FPController::reset  ) 
 

Invoke immediately before entering the main game loop.

void ONE::util::FPController::setActive bool  a  ) 
 

When active, the FPCameraController takes over the mouse. It turns off the mouse cursor and switches to first person controller style. Use this to toggle between your menu system and first person camera control.

When deactivated, the mouse cursor is restored and the mouse is located where it was when the camera controller was activated.

In release mode, the cursor movement is restricted to the window while the controller is active. This does not occur in debug mode because you might hit a breakpoint while the controller is active and it would be annoying to not be able to move the mouse.

void ONE::util::FPController::setCoordinateFrame const CoordinateFrame &  c  ) 
 

Sets to the closest legal controller orientation to the coordinate frame.

void ONE::util::FPController::setMoveRate double  metersPerSecond  ) 
 

Initial value is 10

void ONE::util::FPController::setPosition const Vector3 &  t  )  [inline]
 

void ONE::util::FPController::setTurnRate double  radiansPerSecond  ) 
 

Initial value is PI / 2

void ONE::util::Controlled::shareControllers Controlled peer  )  [inherited]
 

shares the Controller s controlling this object with peer

The controllers stay in control of this object.

void ONE::util::Controlled::transferControllers Controlled peer  )  [inherited]
 

transfers the Controller s controlling this object to peer

The controllers no longer control this object.


Generated on Wed Sep 7 19:03:31 2005 for ONEngine by  doxygen 1.4.3