dtCore::WalkMotionModel Class Reference

A motion model that simulates the action of walking or driving. More...

#include <walkmotionmodel.h>

Inheritance diagram for dtCore::WalkMotionModel:

dtCore::MotionModel dtCore::Base

List of all members.

Public Member Functions

 WalkMotionModel (Keyboard *keyboard=NULL, Mouse *mouse=NULL)
 Constructor.
void SetScene (Scene *scene)
 Sets the active Scene, which is used for ground following.
SceneGetScene ()
 Returns the active Scene.
void SetDefaultMappings (Keyboard *keyboard, Mouse *mouse)
 Sets the input axes to a set of default mappings for mouse and keyboard.
void SetWalkForwardBackwardAxis (Axis *walkForwardBackwardAxis)
 Sets the axis that moves the target forwards (for positive values) or backwards (for negative values).
AxisGetWalkForwardBackwardAxis ()
 Returns the axis that moves the target forwards (for positive values) or backwards (for negative values).
void SetTurnLeftRightAxis (Axis *turnLeftRightAxis)
 Sets the axis that turns the target left (for negative values) or right (for positive values).
AxisGetTurnLeftRightAxis ()
 Returns the axis that turns the target left (for negative values) or right (for positive values).
void SetSidestepLeftRightAxis (Axis *sidestepLeftRightAxis)
 Sets the axis that sidesteps the target left (for negative values) or right (for positive values).
AxisGetSidestepLeftRightAxis ()
 Returns the axis that sidesteps the target left (for negative values) or right (for positive values).
void SetMaximumWalkSpeed (float maximumWalkSpeed)
 Sets the maximum walk speed (meters per second).
float GetMaximumWalkSpeed ()
 Returns the maximum walk speed (meters per second).
void SetMaximumTurnSpeed (float maximumTurnSpeed)
 Sets the maximum turn speed (degrees per second).
float GetMaximumTurnSpeed ()
 Returns the maximum turn speed (degrees per second).
void SetMaximumSidestepSpeed (float maximumSidestepSpeed)
 Sets the maximum sidestep speed (meters per second).
float GetMaximumSidestepSpeed ()
 Returns the maximum sidestep speed (meters per second).
void SetHeightAboveTerrain (float heightAboveTerrain)
 Sets the height to maintain above the terrain (meters).
float GetHeightAboveTerrain ()
 Returns the height to maintain above the terrain (meters).
void SetMaximumStepUpDistance (float maximumStepUpDistance)
 Sets the maximum step-up distance.
float GetMaximumStepUpDistance ()
 Returns the current maximum step-up distance.
virtual void OnMessage (MessageData *data)
 Message handler callback.

Protected Member Functions

virtual ~WalkMotionModel ()
 Destructor.


Detailed Description

A motion model that simulates the action of walking or driving.

Constructor & Destructor Documentation

dtCore::WalkMotionModel::WalkMotionModel ( Keyboard keyboard = NULL,
Mouse mouse = NULL 
)

Constructor.

Parameters:
keyboard the keyboard instance, or 0 to avoid creating default input mappings
mouse the mouse instance, or 0 to avoid creating default input mappings

dtCore::WalkMotionModel::~WalkMotionModel (  )  [protected, virtual]

Destructor.


Member Function Documentation

void dtCore::WalkMotionModel::SetScene ( Scene scene  ) 

Sets the active Scene, which is used for ground following.

Parameters:
scene the active scene

Scene * dtCore::WalkMotionModel::GetScene (  ) 

Returns the active Scene.

Returns:
the active Scene

void dtCore::WalkMotionModel::SetDefaultMappings ( Keyboard keyboard,
Mouse mouse 
)

Sets the input axes to a set of default mappings for mouse and keyboard.

Parameters:
keyboard the keyboard instance
mouse the mouse instance

void dtCore::WalkMotionModel::SetWalkForwardBackwardAxis ( Axis walkForwardBackwardAxis  ) 

Sets the axis that moves the target forwards (for positive values) or backwards (for negative values).

Parameters:
walkForwardBackwardAxis the new forward/backward axis

Axis * dtCore::WalkMotionModel::GetWalkForwardBackwardAxis (  ) 

Returns the axis that moves the target forwards (for positive values) or backwards (for negative values).

Returns:
the current forward/backward axis

void dtCore::WalkMotionModel::SetTurnLeftRightAxis ( Axis turnLeftRightAxis  ) 

Sets the axis that turns the target left (for negative values) or right (for positive values).

Parameters:
turnLeftRightAxis the new turn left/right axis

Axis * dtCore::WalkMotionModel::GetTurnLeftRightAxis (  ) 

Returns the axis that turns the target left (for negative values) or right (for positive values).

Returns:
the current turn left/right axis

void dtCore::WalkMotionModel::SetSidestepLeftRightAxis ( Axis sidestepLeftRightAxis  ) 

Sets the axis that sidesteps the target left (for negative values) or right (for positive values).

Parameters:
sidestepLeftRightAxis the new sidestep left/right axis

Axis * dtCore::WalkMotionModel::GetSidestepLeftRightAxis (  ) 

Returns the axis that sidesteps the target left (for negative values) or right (for positive values).

Returns:
the current sidestep left/right axis

void dtCore::WalkMotionModel::SetMaximumWalkSpeed ( float  maximumWalkSpeed  ) 

Sets the maximum walk speed (meters per second).

Parameters:
maximumWalkSpeed the new maximum walk speed

float dtCore::WalkMotionModel::GetMaximumWalkSpeed (  ) 

Returns the maximum walk speed (meters per second).

Returns:
the current maximum walk speed

void dtCore::WalkMotionModel::SetMaximumTurnSpeed ( float  maximumTurnSpeed  ) 

Sets the maximum turn speed (degrees per second).

Parameters:
maximumTurnSpeed the new maximum turn speed

float dtCore::WalkMotionModel::GetMaximumTurnSpeed (  ) 

Returns the maximum turn speed (degrees per second).

Returns:
the current maximum turn speed

void dtCore::WalkMotionModel::SetMaximumSidestepSpeed ( float  maximumSidestepSpeed  ) 

Sets the maximum sidestep speed (meters per second).

Parameters:
maximumSidestepSpeed the new maximum sidestep speed

float dtCore::WalkMotionModel::GetMaximumSidestepSpeed (  ) 

Returns the maximum sidestep speed (meters per second).

Returns:
the current maximum sidestep speed

void dtCore::WalkMotionModel::SetHeightAboveTerrain ( float  heightAboveTerrain  ) 

Sets the height to maintain above the terrain (meters).

Parameters:
heightAboveTerrain the height to maintain above the terrain

float dtCore::WalkMotionModel::GetHeightAboveTerrain (  ) 

Returns the height to maintain above the terrain (meters).

Returns:
the height to maintain above the terrain

void dtCore::WalkMotionModel::SetMaximumStepUpDistance ( float  maximumStepUpDistance  ) 

Sets the maximum step-up distance.

When clamping to the ground, the maximum step-up distance determines whether to rise to a new level (as when the model climbs a staircase) or to stay at the current level (as when the model passes under a roof). The default is 1.0.

Parameters:
maximumStepUpDistance the new maximum step-up distance

float dtCore::WalkMotionModel::GetMaximumStepUpDistance (  ) 

Returns the current maximum step-up distance.

Returns:
the maximum step-up distance

void dtCore::WalkMotionModel::OnMessage ( MessageData data  )  [virtual]

Message handler callback.

Parameters:
data the message data

Reimplemented from dtCore::Base.


http://www.delta3d.org
2.0.0 generated 14 Feb 2008