![]() |
VR-Forces 4.0.4 Class Documentation
|
DtHumanMovementActuator is a simple movement actuator for lifeforms. More...

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 DtSimComponent * | creator (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 | |
| DtBooleanInputPort * | myMovementDisableInputPort |
| 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 | |
| DtAnalogInputPort * | myMovementDirectionInputPort |
| Input Port Name: desired-movement-direction Input Port Description: Desired movement direction of the entity in radians. | |
| DtAnalogInputPort * | myFacingDirectionInputPort |
| Input Port Name: desired-facing-direction Input Port Description: Desired facing direction of the entity in radians. | |
| DtAnalogInputPort * | mySpeedInputPort |
| Input Port Name: desired-speed Input Port Description: Desired speed of the entity in m/s. | |
| DtInputPortGroup * | myMovementControlInputPortGroup |
| Input Port Group Name: movement-control Input Port Group Description: Collection of inputs specifying the desired movement of the entity. | |
| DtIntegerInputPort * | myDesiredStaticPostureInputPort |
| Input Port Name: desired-static-posture Input Port Description: The desired posture of the entity. | |
| DtVrfMovingObjectStateRepository * | myMovingObjectStateRepository |
| Convenience pointers to our state repository. | |
| DtHumanStateRepository * | myHumanStateRepository |
| Convenience pointers to our state repository. | |
Private Member Functions | |
| DtHumanMovementActuator & | operator= (const DtHumanMovementActuator &orig) |
| Not implemented. | |
| DtHumanMovementActuator (const DtHumanMovementActuator &orig) | |
| Not implemented. | |
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
| typedef std::map<DtLifeformStaticPosture, DtLifeformState> DtHumanMovementActuator::DtStaticToDynamicPostureMap |
| DtHumanMovementActuator::DtHumanMovementActuator | ( | const DtHumanMovementActuator & | orig | ) | [private] |
Not implemented.
| DtHumanMovementActuator::DtHumanMovementActuator | ( | const DtString & | name, |
| DtVrfObject * | owner, | ||
| DtSimManager * | simManager, | ||
| DtComponentDescriptor * | desc = 0, |
||
| DtReaderWriterRegistry * | parentRegistry = 0 |
||
| ) |
(const DtString&,DtVrfObject*,DtSimManager*,
| name | Reader writer name of this component. |
| owner | The DtVrfObject that owns this component |
| simManager | The simulation manager (provides access to terrain, message interface, simulation clock). |
| desc | The component descriptor used to initialize this component. |
| parentRegistry | Pointer to the parent reader writer registry (the containing object that reads/writes this object). |
| virtual DtHumanMovementActuator::~DtHumanMovementActuator | ( | ) | [virtual] |
destructor
| 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.
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*,
| name | Reader writer name of this component. |
| owner | The DtVrfObject that owns this component |
| simManager | The simulation manager (provides access to terrain, message interface, simulation clock). |
| desc | The component descriptor used to initialize this component. |
| parentRegistry | Pointer to the parent reader writer registry (the containing object that reads/writes this object). |
| virtual double DtHumanMovementActuator::calculateMaxSpeed | ( | ) | const [protected, virtual] |
| 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.
| virtual DtLifeformStaticPosture DtHumanMovementActuator::restrictPostureForTerrain | ( | DtLifeformStaticPosture | desiredPosture | ) | [protected, virtual] |
| virtual bool DtHumanMovementActuator::checkForTerrainCollisions | ( | ) | const [protected, virtual] |
| virtual bool DtHumanMovementActuator::checkBlockedByTerrain | ( | const DtVector & | oldLocalPosition, |
| DtVector & | newLocalProjectedLocation | ||
| ) | [protected, virtual] |
Checks for terrain polygons between specified old and new positions.
| virtual double DtHumanMovementActuator::maxUprightTerrainPitch | ( | ) | const [protected, virtual] |
| virtual double DtHumanMovementActuator::maxWalkingSpeed | ( | ) | const [protected, virtual] |
| virtual void DtHumanMovementActuator::initializeStaticToDynamicPostureMap | ( | ) | [protected, virtual] |
Initializes contents of myStaticToDynamicPostureMap, used.
| virtual bool DtHumanMovementActuator::computeEntityDirOfMovement | ( | double & | heading | ) | const [protected, virtual] |
| virtual double DtHumanMovementActuator::calculateTerrainPitch | ( | const DtVector & | localPosition, |
| double | heading, | ||
| const DtAttachedTerrain & | terrain | ||
| ) | const [protected, virtual] |
| 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.
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
DtVrfMovingObjectStateRepository* DtHumanMovementActuator::myMovingObjectStateRepository [protected] |
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.
bool DtHumanMovementActuator::myMutablePitchValid [mutable, protected] |
const DtHumanMovementActuatorDescriptor* DtHumanMovementActuator::myHumanMovementActuatorDescriptor [protected] |
bool DtHumanMovementActuator::myPreviouslyEmbarked [protected] |