VR-Forces 4.0.4 Class Documentation
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions
DtHumanMovementActuator Class Reference

DtHumanMovementActuator is a simple movement actuator for lifeforms. More...

Inheritance diagram for DtHumanMovementActuator:
Inheritance graph
[legend]

List of all members.

Public Types

typedef std::map
< DtLifeformStaticPosture,
DtLifeformState > 
DtStaticToDynamicPostureMap

Public Member Functions

 DtHumanMovementActuator (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 (const DtString&,DtVrfObject*,DtSimManager*,
virtual ~DtHumanMovementActuator ()
 destructor
virtual bool init ()
 to get access to the entity's localStateRepository, which this component will update, and then connect to the controller's ports.
virtual DtString type () const
 Returns a string identifies the class type of component.
virtual void tick ()
 This gives the thread of control to the component.

Static Public Member Functions

static DtSimComponentcreator (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 (const DtString&,DtVrfObject*,DtSimManager*,

Protected Member Functions

virtual double calculateMaxSpeed () const
virtual bool disableControl ()
 Checks if another components needs to disable the movement actuator Currently the DI-Guy controller does this so that it can keep the entity insynch with the animation it's DI-Guy representation is performing.
virtual double maxSpeedSoilFactor () const
virtual DtVector calculateProjectedLocation (const DtVector &oldLocalPosition, const DtVector &newBodyVelocity, double newHeading)
virtual void calculateOrientationAndPosition (const DtVector &newLocalProjectedLocation, double newHeading, double newFacingOrientation, DtDcm &newLocalOrientation, DtDcm &newLocalDirectionOfMovement, DtVector &newLocalPosition)
virtual void calculateOrientationAndPositionCrawling (const DtVector &newLocalProjectedLocation, double newHeading, double newFacingOrientation, DtDcm &newLocalOrientation, DtDcm &newLocalDirectionOfMovement, DtVector &newLocalPosition)
virtual void groundClamp (double heading, const DtVector &location, DtAttachedTerrain &terrainDatabase, DtVector &newNormal)
virtual void calculateDirectionOfLinearMotion (const DtDcm &newLocalOrientation, double desiredDirectionOfMovement, const DtVector &newLocalPosition, DtDcm &newLocalDirectionOfLinearMotion)
virtual void updateRepository (const DtVector &position, const DtVector &velocity, const DtVector &acceleration, const DtTaitBryan &localOrientation, const DtVector &rotationalVelocity, double newHeading)
virtual void computeAndSetPosture ()
 The main method for everything to do with posture in this actuator.
virtual DtLifeformState computeDynamicPosture (DtLifeformStaticPosture staticPosture)
 Determines the correct dynamic posture for the entity based on the desired static posture passed in, and the current state of the entity.
virtual DtLifeformStaticPosture restrictPostureForTerrain (DtLifeformStaticPosture desiredPosture)
virtual bool checkForTerrainCollisions () const
virtual bool checkBlockedByTerrain (const DtVector &oldLocalPosition, DtVector &newLocalProjectedLocation)
 Checks for terrain polygons between specified old and new positions.
virtual double maxUprightTerrainPitch () const
virtual double maxWalkingSpeed () const
virtual void initializeStaticToDynamicPostureMap ()
 Initializes contents of myStaticToDynamicPostureMap, used.
virtual bool computeEntityDirOfMovement (double &heading) const
virtual double calculateTerrainPitch (const DtVector &localPosition, double heading, const DtAttachedTerrain &terrain) const
virtual bool createPorts ()
 Overridden to create the movement control input ports.
virtual bool createPortGroups ()
 Overridden to create the movement control input port group.

Protected Attributes

DtBooleanInputPortmyMovementDisableInputPort
 Input Port Name: movement-disable
Input Port Description: Checks to see if another component is determining the movements of the entity.
double myMutablePitch
 This value is the pitch of the terrain under the entity.
bool myMutablePitchValid
DtVector myLastParentPosition
DtStaticToDynamicPostureMap myStaticToDynamicPostureMap
const
DtHumanMovementActuatorDescriptor
myHumanMovementActuatorDescriptor
bool myPreviouslyEmbarked
Ports and Port Groups
DtAnalogInputPortmyMovementDirectionInputPort
 Input Port Name: desired-movement-direction
Input Port Description: Desired movement direction of the entity in radians.
DtAnalogInputPortmyFacingDirectionInputPort
 Input Port Name: desired-facing-direction
Input Port Description: Desired facing direction of the entity in radians.
DtAnalogInputPortmySpeedInputPort
 Input Port Name: desired-speed
Input Port Description: Desired speed of the entity in m/s.
DtInputPortGroupmyMovementControlInputPortGroup
 Input Port Group Name: movement-control
Input Port Group Description: Collection of inputs specifying the desired movement of the entity.
DtIntegerInputPortmyDesiredStaticPostureInputPort
 Input Port Name: desired-static-posture
Input Port Description: The desired posture of the entity.
DtVrfMovingObjectStateRepositorymyMovingObjectStateRepository
 Convenience pointers to our state repository.
DtHumanStateRepositorymyHumanStateRepository
 Convenience pointers to our state repository.

Private Member Functions

DtHumanMovementActuatoroperator= (const DtHumanMovementActuator &orig)
 Not implemented.
 DtHumanMovementActuator (const DtHumanMovementActuator &orig)
 Not implemented.

Detailed Description

DtHumanMovementActuator is a simple movement actuator for lifeforms.

Developer Description: It moves in the requested speed (clamped by the max speed of the entity) and direction. The entity will speed up, slow down, and turn instantly when the requested values change.

Uses Descriptor Type: DtHumanMovementActuatorDescriptor


Member Typedef Documentation


Constructor & Destructor Documentation

Not implemented.

DtHumanMovementActuator::DtHumanMovementActuator ( const DtString name,
DtVrfObject owner,
DtSimManager simManager,
DtComponentDescriptor desc = 0,
DtReaderWriterRegistry parentRegistry = 0 
)

(const DtString&,DtVrfObject*,DtSimManager*,

Parameters:
nameReader writer name of this component.
ownerThe DtVrfObject that owns this component
simManagerThe simulation manager (provides access to terrain, message interface, simulation clock).
descThe component descriptor used to initialize this component.
parentRegistryPointer to the parent reader writer registry (the containing object that reads/writes this object).
(const DtString&,DtVrfObject*,DtSimManager*, DtComponentDescriptor*,DtReaderWriterRegistry* parentRegistry)

destructor


Member Function Documentation

DtHumanMovementActuator& DtHumanMovementActuator::operator= ( const DtHumanMovementActuator orig) [private]

Not implemented.

virtual bool DtHumanMovementActuator::init ( ) [virtual]

to get access to the entity's localStateRepository, which this component will update, and then connect to the controller's ports.

Reimplemented from DtActuatorComponent.

virtual DtString DtHumanMovementActuator::type ( ) const [virtual]

Returns a string identifies the class type of component.

Type values are defined in compTypes.h. DtSimComponent creation functions are registered with the DtSimComponentFactory using the type values as the key.

Returns:
DtHumanMovementActuatorType

Reimplemented from DtSimComponent.

virtual void DtHumanMovementActuator::tick ( ) [virtual]

This gives the thread of control to the component.

The component is ticked once each simulation from by the component list it's on. This base class tick has no functionality.

Reimplemented from DtSimComponent.

static DtSimComponent* DtHumanMovementActuator::creator ( const DtString name,
DtVrfObject owner,
DtSimManager simManager,
DtComponentDescriptor desc = 0,
DtReaderWriterRegistry parentRegistry = 0 
) [static]

(const DtString&,DtVrfObject*,DtSimManager*,

Parameters:
nameReader writer name of this component.
ownerThe DtVrfObject that owns this component
simManagerThe simulation manager (provides access to terrain, message interface, simulation clock).
descThe component descriptor used to initialize this component.
parentRegistryPointer to the parent reader writer registry (the containing object that reads/writes this object).
(const DtString&,DtVrfObject*,DtSimManager*, DtComponentDescriptor*,DtReaderWriterRegistry* parentRegistry)

Returns:
New instance of this class.
virtual double DtHumanMovementActuator::calculateMaxSpeed ( ) const [protected, virtual]
Returns:
The current max speed based on pitch, soil type, and capabilities of the entity.
virtual bool DtHumanMovementActuator::disableControl ( ) [protected, virtual]

Checks if another components needs to disable the movement actuator Currently the DI-Guy controller does this so that it can keep the entity insynch with the animation it's DI-Guy representation is performing.

virtual double DtHumanMovementActuator::maxSpeedSoilFactor ( ) const [protected, virtual]
virtual DtVector DtHumanMovementActuator::calculateProjectedLocation ( const DtVector oldLocalPosition,
const DtVector newBodyVelocity,
double  newHeading 
) [protected, virtual]
virtual void DtHumanMovementActuator::calculateOrientationAndPosition ( const DtVector newLocalProjectedLocation,
double  newHeading,
double  newFacingOrientation,
DtDcm &  newLocalOrientation,
DtDcm &  newLocalDirectionOfMovement,
DtVector newLocalPosition 
) [protected, virtual]
virtual void DtHumanMovementActuator::calculateOrientationAndPositionCrawling ( const DtVector newLocalProjectedLocation,
double  newHeading,
double  newFacingOrientation,
DtDcm &  newLocalOrientation,
DtDcm &  newLocalDirectionOfMovement,
DtVector newLocalPosition 
) [protected, virtual]
virtual void DtHumanMovementActuator::groundClamp ( double  heading,
const DtVector location,
DtAttachedTerrain terrainDatabase,
DtVector newNormal 
) [protected, virtual]
virtual void DtHumanMovementActuator::calculateDirectionOfLinearMotion ( const DtDcm &  newLocalOrientation,
double  desiredDirectionOfMovement,
const DtVector newLocalPosition,
DtDcm &  newLocalDirectionOfLinearMotion 
) [protected, virtual]
virtual void DtHumanMovementActuator::updateRepository ( const DtVector position,
const DtVector velocity,
const DtVector acceleration,
const DtTaitBryan &  localOrientation,
const DtVector rotationalVelocity,
double  newHeading 
) [protected, virtual]
virtual void DtHumanMovementActuator::computeAndSetPosture ( ) [protected, virtual]

The main method for everything to do with posture in this actuator.

This determines the correct posture based on the input port and speed of the entity, and then sets this posture to the state repository.

virtual DtLifeformState DtHumanMovementActuator::computeDynamicPosture ( DtLifeformStaticPosture  staticPosture) [protected, virtual]

Determines the correct dynamic posture for the entity based on the desired static posture passed in, and the current state of the entity.

Returns:
The static posture closest to the desired posture that is allowed on the current terrain. For example, standing upright on a steep hill is not allowed, so the return would be prone.
virtual bool DtHumanMovementActuator::checkForTerrainCollisions ( ) const [protected, virtual]
Returns:
Boolean signifying whether or not the terrain should be checked for collisions with the entity's bounding volume while it moves. If this returns true, the entity will not move through the terrain. If this is false, it may move through terrain polygons, such as building walls when moving to a new location.
Note:
it currently just returns the value of the user specified parameter in the automotivePSR.
virtual bool DtHumanMovementActuator::checkBlockedByTerrain ( const DtVector oldLocalPosition,
DtVector newLocalProjectedLocation 
) [protected, virtual]

Checks for terrain polygons between specified old and new positions.

Returns:
True if there are any blocking polygons, and in that case also sets newLocalProjectedLocation to the position just before the polygons are hit.
virtual double DtHumanMovementActuator::maxUprightTerrainPitch ( ) const [protected, virtual]
Returns:
Maximum terrain pitch at which entity can maintain a static upright posture (i.e. standing posture). Actuator will switch to a prone posture when terrain pitch exceeds this value. Units in radians. Returns value from myHumanMovementActuatorDescriptor if it exists, otherwise, returns 0.5236 (30 degrees) by default.
virtual double DtHumanMovementActuator::maxWalkingSpeed ( ) const [protected, virtual]
Returns:
Maximum speed at which entity will walk. Actuator will switch from a walking posture to a running posture when current speed exceeds this value. Returns value from myHumanmovementActuatorDescriptor if it exists, otherwise returns 2.0 by default. Units in meters/second.
virtual void DtHumanMovementActuator::initializeStaticToDynamicPostureMap ( ) [protected, virtual]

Initializes contents of myStaticToDynamicPostureMap, used.

virtual bool DtHumanMovementActuator::computeEntityDirOfMovement ( double &  heading) const [protected, virtual]
Returns:
virtual double DtHumanMovementActuator::calculateTerrainPitch ( const DtVector localPosition,
double  heading,
const DtAttachedTerrain terrain 
) const [protected, virtual]
Returns:
The pitch of the terrain at the specified position in the specified direction.
virtual bool DtHumanMovementActuator::createPorts ( ) [protected, virtual]

Overridden to create the movement control input ports.

Reimplemented from DtSimComponent.

virtual bool DtHumanMovementActuator::createPortGroups ( ) [protected, virtual]

Overridden to create the movement control input port group.

Reimplemented from DtSimComponent.


Member Data Documentation

Input Port Name: desired-movement-direction
Input Port Description: Desired movement direction of the entity in radians.


Input Port Range: 0 - 2*pi
Input Port Default Value: N/A
Input Group Parent: movement-control

Input Port Name: desired-facing-direction
Input Port Description: Desired facing direction of the entity in radians.

NOTE: This input port is currently ignored. It is here for future expansion. The entity currently always faces in its movement direction. Input Port Range: 0 - 2*pi
Input Port Default Value: N/A
Input Group Parent: movement-control

Input Port Name: desired-speed
Input Port Description: Desired speed of the entity in m/s.


Input Port Range: 0 and up. Input Port Default Value: N/A
Input Group Parent: movement-control

Input Port Group Name: movement-control
Input Port Group Description: Collection of inputs specifying the desired movement of the entity.


Input Port Name: desired-static-posture
Input Port Description: The desired posture of the entity.

This is a static (non-moving) posture, and will be mapped to an appropriate moving posture based on the actual speed of the entity.
Input Port Range: See DtLifeformStaticPosture. Input Port Default Value: DtStaticPostureUpright

Input Port Name: movement-disable
Input Port Description: Checks to see if another component is determining the movements of the entity.

Currently just the DI-Guy controller will take control to handle any translational, directional or posture changes that are associated with the animation task the entity is performing.
Input Port Range:
Input Port Default Value: false

Convenience pointers to our state repository.

Convenience pointers to our state repository.

double DtHumanMovementActuator::myMutablePitch [mutable, protected]

This value is the pitch of the terrain under the entity.

Since it is expensive to calculate, but needed at a number of places each tick, it is stored here when calculated, and then user other times.


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

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)