![]() |
VR-Forces 4.0.4 Class Documentation
|
Controls appearances and animations for an entity that is represented by a DI-Guy 3D visual representation. More...

Public Member Functions | |
| DtDIGuyController (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0) | |
| (const DtString&,DtVrfObject*,DtSimManager*, | |
| virtual | ~DtDIGuyController () |
| destructor | |
| virtual DtString | type () const |
| Returns a string identifies the class type of component. | |
| virtual bool | init () |
| Initialize the component. | |
| virtual bool | createPSR () |
| Creates myProcessState data member, and adds it to our process state repository manager. | |
| virtual void | tick () |
| Calculate new control values. | |
| virtual void | taskedTick (DtTime &dT) |
| Called if we are tasked to perform an animation. | |
| virtual bool | intrinsicOverride () |
| Checks if there's some intrinsic behaviour like collision avoidance or shooting the enemy that needs to break in and happen during a tasked animation. | |
| virtual bool | intrinsicTick (DtLifeformStaticPosture post, double speed, DtWeaponState weapon, DtString &demeanor) |
| When the entity is not tasked to perform an animation, this controller looks at the entity's current posture, speed, weapon state( if any), and demeanor( dead, aiming, sick...) to determine the best animation for the entity. | |
| virtual bool | tickWhileDestroyed () const |
| virtual DtBooleanOutputPort * | movementDisablePort () const |
| virtual void | setCurrentAnimation (DtDIGuyAnimation *animation) |
| virtual void | sendSetPosture (DtLifeformState post) |
| Sends out our animation's posture when we're finished performing the animation so the actuator knows what the ending posture was and doesn't revert to an old posture. | |
| virtual void | processSetCharacterAppearance (DtSimMessage *msg) |
| virtual void | processSetRestore (DtSimMessage *msg) |
| virtual void | processAnimationTask (DtSimMessage *msg) |
| virtual void | clearTask () |
| Both call reset to clear out the tasked animation, set the posture correctly and release control of movement and posture to the other movement components. | |
| virtual void | taskComplete (bool success=true) |
| If we are currently tasked, this will cause us to notify the entity that we're done and delete the task. | |
| virtual void | reset () |
| virtual void | updateAnimationState (DtLifeformStaticPosture post, double speed, DtWeaponState weapon, const DtString &demeanor) |
| virtual DtDIGuyDirectionType | directionStringToEnum (const DtString &direction) |
| Given a DI-Guy direction string return the enum that goes with it. | |
Static Public Member Functions | |
| static void | setAppearanceCallback (DtSimMessage *msg, void *usr) |
| Calls processSetArmed(). | |
| static void | setRestoreCallback (DtSimMessage *msg, void *usrData) |
| static void | animationTaskCallback (DtSimMessage *msg, void *usrData) |
| static DtSimComponent * | creator (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0) |
| (const DtString&,DtVrfObject*,DtSimManager*, | |
Protected Member Functions | |
| virtual void | registerRadioMessageCallbacks () |
| Registers for setCharacterAppearanceDataRequest from the local entity's radio. | |
| virtual void | registerTaskMsgCallbacks () |
| Registers for animation tasks. | |
| DtDIGuyController () | |
| Not implemented. | |
| DtDIGuyController (const DtDIGuyController &orig) | |
| Not implemented. | |
| const DtDIGuyController & | operator= (const DtDIGuyController &orig) |
| Not implemented. | |
| virtual bool | createPorts () |
| Overridden to create the local ports. | |
| virtual bool | createCollisionPort () |
| These are called in init to create the ports used to communicate with the controller. | |
| virtual bool | createAimDirectionPort () |
| virtual bool | createMovementDisablePort () |
| virtual bool | determineDemeanor (DtWeaponState weapon, DtString &demeanor) |
| virtual void | determineDirection () |
| virtual void | updatePosition (const DtTime &dT, DtTaitBryan &localOrientation) |
Protected Attributes | |
| DtDIGuyCharacterData * | myCharacterData |
| DtVrfMovingObjectStateRepository * | myLocalState |
| DtDIGuyAnimation * | myDefaultAnimation |
| DtLifeformStaticPosture | myDefaultAnimationPosture |
| bool | myTaskInterrupted |
| DtDIGuyAnimation * | myTaskedAnimation |
| DtTaitBryan | myTaskedOrientation |
| DtDIGuyAnimation * | myCurrentAnimation |
| DtWeaponState | myCurrentAnimationWeaponState |
| DtLifeformStaticPosture | myCurrentAnimationPosture |
| double | myCurrentAnimationSpeed |
| double | myAnimationDuration |
| These values are stored in the PSR Do we want this animation to be performed only once? Indefinitely? Or for a specified period of time? some number in seconds;. | |
| DtTime | myTimeElapsed |
| bool | myAmRotating |
| double | myDirectionOfMovement |
| DtDIGuyControllerPSR * | myProcessState |
| Container for state data associated with this component. | |
| DtBooleanInputPort * | myCollisionPort |
| Input Port Name: collision Input Port Description: Checks to see if we're avoiding a collision. | |
| DtAnalogInputPort * | myAimDirectionPort |
| Input Port Name: aim-direction Input Port Description: Specifies the heading in which the entity should aim its weapon. | |
| DtBooleanOutputPort * | myMovementDisablePort |
| Output Port Name: movement-disable Output Port Description: When true, the movement actuator is disabled. | |
| bool | myTickWhileDead |
| bool | myFirstTick |
| bool | myNeedUpdate |
| bool | myDisableMovement |
Controls appearances and animations for an entity that is represented by a DI-Guy 3D visual representation.
End User Description: This controller is used on entities that have a DI-Guy driven 3D visual representation. This controller enables Set DI-Guy Appearance and DI-Guy animation tasks, and handles these set/task messages by sending out special DI-Guy control messages to the visual system. in the case of DI-Guy animations, this controller will suppress movement by a normal actuator and move the the entity directly in line with the selected animation. Uses Descriptor Type: DtComponentDescriptor
| DtDIGuyController::DtDIGuyController | ( | 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 DtDIGuyController::~DtDIGuyController | ( | ) | [virtual] |
destructor
| DtDIGuyController::DtDIGuyController | ( | ) | [protected] |
Not implemented.
| DtDIGuyController::DtDIGuyController | ( | const DtDIGuyController & | orig | ) | [protected] |
Not implemented.
| virtual DtString DtDIGuyController::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.
Implements DtTaskControllerComponent.
| virtual bool DtDIGuyController::init | ( | ) | [virtual] |
Initialize the component.
Calls registerRadioMessageCallbacks()
Reimplemented from DtControllerComponent.
| virtual bool DtDIGuyController::createPSR | ( | ) | [virtual] |
Creates myProcessState data member, and adds it to our process state repository manager.
Passes in the name and type specified in the component descriptor (if they exist) to the DtVrfProcessStateRepository::createRepository factory method. If name and/or type is not specified, uses the appropriate default strings defined in procSRTypes.h.
| virtual void DtDIGuyController::tick | ( | ) | [virtual] |
Calculate new control values.
Reimplemented from DtSimComponent.
| virtual void DtDIGuyController::taskedTick | ( | DtTime & | dT | ) | [virtual] |
Called if we are tasked to perform an animation.
Disables the movement actuator so that position and velocity settings are controlled from this controller. Updates the position and velocity each tick.
| virtual bool DtDIGuyController::intrinsicOverride | ( | ) | [virtual] |
Checks if there's some intrinsic behaviour like collision avoidance or shooting the enemy that needs to break in and happen during a tasked animation.
| virtual bool DtDIGuyController::intrinsicTick | ( | DtLifeformStaticPosture | post, |
| double | speed, | ||
| DtWeaponState | weapon, | ||
| DtString & | demeanor | ||
| ) | [virtual] |
When the entity is not tasked to perform an animation, this controller looks at the entity's current posture, speed, weapon state( if any), and demeanor( dead, aiming, sick...) to determine the best animation for the entity.
| virtual bool DtDIGuyController::tickWhileDestroyed | ( | ) | const [virtual] |
Reimplemented from DtSimComponent.
| virtual DtBooleanOutputPort* DtDIGuyController::movementDisablePort | ( | ) | const [virtual] |
| virtual void DtDIGuyController::setCurrentAnimation | ( | DtDIGuyAnimation * | animation | ) | [virtual] |
| virtual void DtDIGuyController::sendSetPosture | ( | DtLifeformState | post | ) | [virtual] |
Sends out our animation's posture when we're finished performing the animation so the actuator knows what the ending posture was and doesn't revert to an old posture.
| static void DtDIGuyController::setAppearanceCallback | ( | DtSimMessage * | msg, |
| void * | usr | ||
| ) | [static] |
Calls processSetArmed().
| virtual void DtDIGuyController::processSetCharacterAppearance | ( | DtSimMessage * | msg | ) | [virtual] |
| static void DtDIGuyController::setRestoreCallback | ( | DtSimMessage * | msg, |
| void * | usrData | ||
| ) | [static] |
| virtual void DtDIGuyController::processSetRestore | ( | DtSimMessage * | msg | ) | [virtual] |
| static void DtDIGuyController::animationTaskCallback | ( | DtSimMessage * | msg, |
| void * | usrData | ||
| ) | [static] |
| virtual void DtDIGuyController::processAnimationTask | ( | DtSimMessage * | msg | ) | [virtual] |
| virtual void DtDIGuyController::clearTask | ( | ) | [virtual] |
Both call reset to clear out the tasked animation, set the posture correctly and release control of movement and posture to the other movement components.
Reimplemented from DtSingleTaskControllerComponent.
| virtual void DtDIGuyController::taskComplete | ( | bool | success = true | ) | [virtual] |
If we are currently tasked, this will cause us to notify the entity that we're done and delete the task.
To indicate that the task has failed (and is being abandoned) call this method with success set to false.
Reimplemented from DtSingleTaskControllerComponent.
| virtual void DtDIGuyController::reset | ( | ) | [virtual] |
| virtual void DtDIGuyController::updateAnimationState | ( | DtLifeformStaticPosture | post, |
| double | speed, | ||
| DtWeaponState | weapon, | ||
| const DtString & | demeanor | ||
| ) | [virtual] |
| virtual DtDIGuyDirectionType DtDIGuyController::directionStringToEnum | ( | const DtString & | direction | ) | [virtual] |
Given a DI-Guy direction string return the enum that goes with it.
| static DtSimComponent* DtDIGuyController::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 void DtDIGuyController::registerRadioMessageCallbacks | ( | ) | [protected, virtual] |
Registers for setCharacterAppearanceDataRequest from the local entity's radio.
| virtual void DtDIGuyController::registerTaskMsgCallbacks | ( | ) | [protected, virtual] |
Registers for animation tasks.
Reimplemented from DtTaskControllerComponent.
| const DtDIGuyController& DtDIGuyController::operator= | ( | const DtDIGuyController & | orig | ) | [protected] |
Not implemented.
| virtual bool DtDIGuyController::createPorts | ( | ) | [protected, virtual] |
Overridden to create the local ports.
Reimplemented from DtSimComponent.
| virtual bool DtDIGuyController::createCollisionPort | ( | ) | [protected, virtual] |
These are called in init to create the ports used to communicate with the controller.
| virtual bool DtDIGuyController::createAimDirectionPort | ( | ) | [protected, virtual] |
| virtual bool DtDIGuyController::createMovementDisablePort | ( | ) | [protected, virtual] |
| virtual bool DtDIGuyController::determineDemeanor | ( | DtWeaponState | weapon, |
| DtString & | demeanor | ||
| ) | [protected, virtual] |
| virtual void DtDIGuyController::determineDirection | ( | ) | [protected, virtual] |
| virtual void DtDIGuyController::updatePosition | ( | const DtTime & | dT, |
| DtTaitBryan & | localOrientation | ||
| ) | [protected, virtual] |
DtDIGuyCharacterData* DtDIGuyController::myCharacterData [protected] |
DtDIGuyAnimation* DtDIGuyController::myDefaultAnimation [protected] |
bool DtDIGuyController::myTaskInterrupted [protected] |
DtDIGuyAnimation* DtDIGuyController::myTaskedAnimation [protected] |
DtTaitBryan DtDIGuyController::myTaskedOrientation [protected] |
DtDIGuyAnimation* DtDIGuyController::myCurrentAnimation [protected] |
DtWeaponState DtDIGuyController::myCurrentAnimationWeaponState [protected] |
double DtDIGuyController::myCurrentAnimationSpeed [protected] |
double DtDIGuyController::myAnimationDuration [protected] |
These values are stored in the PSR Do we want this animation to be performed only once? Indefinitely? Or for a specified period of time? some number in seconds;.
DtTime DtDIGuyController::myTimeElapsed [protected] |
bool DtDIGuyController::myAmRotating [protected] |
double DtDIGuyController::myDirectionOfMovement [protected] |
DtDIGuyControllerPSR* DtDIGuyController::myProcessState [protected] |
Container for state data associated with this component.
This state is saved and restored as part of a scenario (or checkpoint).
DtBooleanInputPort* DtDIGuyController::myCollisionPort [protected] |
Input Port Name: collision
Input Port Description: Checks to see if we're avoiding a collision.
Overrides DI-Guy tasked animations. Need to avoid collisions first.
Input Port Range:
Input Port Default Value:
Input Group Parent:
DtAnalogInputPort* DtDIGuyController::myAimDirectionPort [protected] |
Input Port Name: aim-direction
Input Port Description: Specifies the heading in which the entity should aim its weapon.
This information will override DI-Guy Tasked animations.
Input Port Range: Heading value in radians.
Input Port Default Value: N/A
Input Group Parent:
Output Port Name: movement-disable
Output Port Description: When true, the movement actuator is disabled.
When an entity's DI-Guy representation is performing an animation the movement actuator is no longer controlling the entity's movements. This controller takes over those responsibilities by providing very simple translational and directional changes that are associated with the tasked animation if any. Once the animation task is complete the movement controls are given back to the movement actuators. Output Port Default Value: False
bool DtDIGuyController::myTickWhileDead [protected] |
bool DtDIGuyController::myFirstTick [protected] |
bool DtDIGuyController::myNeedUpdate [protected] |
bool DtDIGuyController::myDisableMovement [protected] |