HumanMatrixGetter Class Reference

A matrix getter to move like in any Quake-like game, without the ability to get stuck to the ground (kind of "Flying human matrix getter"). More...

#include <HumanMatrixGetter.h>

Inheritance diagram for HumanMatrixGetter:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 HumanMatrixGetter ()
virtual bool handleEvent (NetControlEvent *pEvent, TNL::EventConnection *pConnection)
 Handle "one-shot" events (Key pressed for firing, for example).
virtual void handleFrame (double elapsed)
 Handle on-frame (Coninuous) update for inputs.
void setByFrame (const osg::Vec3 &EyePos, const osg::Vec3 &Dir, const osg::Vec3 &Up)
 Vectors Dir & Up do not need to be normalized.
virtual osg::Matrix getMatrix () const
virtual osg::Matrix getInverseMatrix () const
osg::Matrix yawPitchRoll (osg::Vec3::value_type yaw, osg::Vec3::value_type pitch, osg::Vec3::value_type roll) const
 Performs a triple rotation as osg::Matrix::rotate(double, Vec3, double, Vec3, double, Vec3) does, but with a limit on pitch rotation.

Protected Attributes

osg::Vec3 EyePos
osg::Vec3 Dir
osg::Vec3 Up
 Defines a frame and a reference point (The last vector, named 'Right', is = Up^Dir).
osg::Vec3::value_type MovingSpeed
 Camera speed in world units.

Static Protected Attributes

static const osg::Vec3::value_type AlphaMin = 0.008
 Minumum angle for pitch.


Detailed Description

A matrix getter to move like in any Quake-like game, without the ability to get stuck to the ground (kind of "Flying human matrix getter").

Note:
Not thread safe because it has nothing to do with other threads than GFX.
Author:
Sukender
Version:
0.2.0

Definition at line 40 of file HumanMatrixGetter.h.


Constructor & Destructor Documentation

HumanMatrixGetter::HumanMatrixGetter (  )  [inline]

Definition at line 42 of file HumanMatrixGetter.h.


Member Function Documentation

virtual osg::Matrix HumanMatrixGetter::getInverseMatrix (  )  const [inline, virtual]

Implements MatrixGetter.

Definition at line 58 of file HumanMatrixGetter.h.

virtual osg::Matrix HumanMatrixGetter::getMatrix (  )  const [inline, virtual]

Implements MatrixGetter.

Definition at line 57 of file HumanMatrixGetter.h.

References MatrixGetter::getInverseMatrix().

virtual bool HumanMatrixGetter::handleEvent ( NetControlEvent pEvent,
TNL::EventConnection pConnection 
) [inline, virtual]

Handle "one-shot" events (Key pressed for firing, for example).

If pConnection parameter is not NULL, then the event should be considered as a client event (generally sent instead if processed).

Returns:
true if the event is handled, ie. should not be processed by other handlers. Returning true DOES NOT MEAN that the corresponding (mapped) OSG input is handled ! Handling controls is different from OSG.
Warning:
This is called on event thread (generally GFX thread).

Implements ControlEventHandler.

Definition at line 44 of file HumanMatrixGetter.h.

void HumanMatrixGetter::handleFrame ( double  elapsed  )  [virtual]

void HumanMatrixGetter::setByFrame ( const osg::Vec3 &  EyePos,
const osg::Vec3 &  Dir,
const osg::Vec3 &  Up 
) [inline]

Vectors Dir & Up do not need to be normalized.

Definition at line 48 of file HumanMatrixGetter.h.

osg::Matrix HumanMatrixGetter::yawPitchRoll ( osg::Vec3::value_type  yaw,
osg::Vec3::value_type  pitch,
osg::Vec3::value_type  roll 
) const

Performs a triple rotation as osg::Matrix::rotate(double, Vec3, double, Vec3, double, Vec3) does, but with a limit on pitch rotation.

Definition at line 81 of file HumanMatrixGetter.cpp.

References AlphaMin, ASSERT, Dir, and Up.

Referenced by handleFrame().


Member Data Documentation

const osg::Vec3::value_type HumanMatrixGetter::AlphaMin = 0.008 [static, protected]

Minumum angle for pitch.

Definition at line 67 of file HumanMatrixGetter.h.

Referenced by yawPitchRoll().

osg::Vec3 HumanMatrixGetter::Dir [protected]

Definition at line 64 of file HumanMatrixGetter.h.

Referenced by handleFrame(), and yawPitchRoll().

osg::Vec3 HumanMatrixGetter::EyePos [protected]

Definition at line 64 of file HumanMatrixGetter.h.

Referenced by handleFrame().

osg::Vec3::value_type HumanMatrixGetter::MovingSpeed [protected]

Camera speed in world units.

Definition at line 66 of file HumanMatrixGetter.h.

Referenced by handleFrame().

osg::Vec3 HumanMatrixGetter::Up [protected]

Defines a frame and a reference point (The last vector, named 'Right', is = Up^Dir).

Definition at line 64 of file HumanMatrixGetter.h.

Referenced by handleFrame(), and yawPitchRoll().


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

Generated on Sun Jan 17 11:39:28 2010 for PVLE (Pro-Vocation Light Engine) by  doxygen 1.5.9