![]() |
VR-Forces 4.0.4 Class Documentation
|
DtHumanMoveAlongController is a controller that models movement to a <location> or <waypoint> for aggregated entities. More...

Public Member Functions | |
| DtAggregatedMoveToController (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0) | |
| Constructor. | |
| virtual | ~DtAggregatedMoveToController () |
| Destructor. | |
| virtual bool | init () |
| Init. Call immediately after construction. | |
| virtual DtString | type () const |
| virtual void | tick () |
| This components simulation tick. | |
Static Public Member Functions | |
| static void | moveToCallback (DtSimMessage *msg, void *usr) |
| Callback function that handles DtMoveToType tasks. | |
| static void | setLocationCallback (DtSimMessage *msg, void *usr) |
| Callback function that handles DtSetLocationRequest set data requests. | |
| static void | moveToLocationCallback (DtSimMessage *msg, void *usr) |
| Callback function that handles DtMoveToLocation tasks. | |
| static void | moveIntoFormationCallback (DtSimMessage *msg, void *usr) |
| Callback function that handles DtMoveIntoFormation tasks. | |
| static void | turnToHeadingCallback (DtSimMessage *msg, void *usrData) |
| Callback function that handles DtTurnToHeading tasks. | |
| static DtSimComponent * | creator (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0) |
| Static creator function for factory registration. | |
| static void | modifyVrfObjectCallback (DtSimMessage *msg, void *usr) |
| Calls processModifyVrfObject. | |
Protected Member Functions | |
| virtual void | processMoveToTask (DtSimMessage *msg) |
| Sets world destination from the task. | |
| virtual void | processMoveToLocationTask (DtSimMessage *msg) |
| virtual void | processDestinationChanged () |
| Ensures that the destination stored in the ProcessStateRepository is consistent with the location of the destination control point. | |
| virtual bool | setupDestination () |
| Look up the control point by name and set the myControlPoint member to point to it. | |
| virtual void | setupDestinationVector () const |
| Sets up a vector from the current destination location to the entity's location to use in determining when/if the entity has passed its destination location. | |
| virtual void | invalidateDestinationVector () const |
| Tells the component that any cached destination vector should be recalculated. | |
| virtual bool | atDestination () |
| Are we within the at-distance parameter to the destination? If the myDistanceSquared member calculated in tick() is less than or equal to the square of the value provided in the at-distance parameter of the DtGroundMoveToDescriptor, atDestination() sets myAtDestination to true. | |
| virtual void | doMoving () |
| Calls findDesiredHeading() and then sets port values based on those results. | |
| virtual double | findDesiredHeading () |
| Determines the desired heading. | |
| virtual void | moveToDestination () |
| Attempts to move to the destination location. Override to provide movement functionality. | |
| virtual void | stop () |
| Set port values for stopping, and mark the task complete. | |
| virtual void | registerTaskMsgCallbacks () |
| Overridden to register interest in move to messages. | |
| virtual void | processModifyVrfObject (DtSimMessage *msg) |
| Resets the destination vector when the location of the entity to which this controller is attached is changed through a DtIfModifyVrfObject message (i.e. | |
| virtual void | processSetLocation (DtSimMessage *msg) |
| Resets the destination vector when the location of the entity to which this controller is attached is changed through a set location request. | |
| virtual bool | createPortGroups () |
| Creates and initializes port groups. | |
| virtual bool | createPorts () |
| Creates myDestinationOutputPort. | |
| virtual bool | createPSR () |
| Creates myProcessState data member, and adds it to our process state repository manager. | |
| virtual double | distanceToDestination () const |
| virtual void | clearTask () |
| Override to deactivate myHumanMovementControlOutputPortGroup. | |
| virtual double | atDistance () const |
| Maximum distance at which entity is considered to be 'at' goal. | |
| virtual void | processMoveIntoFormationTask (DtSimMessage *msg) |
| Implements turn to heading task by sending a set location and set heading request to ourself. | |
| virtual void | processTurnToHeadingTask (DtSimMessage *msg) |
| Implements turn to heading task by sending a set heading request to ourself. | |
| virtual void | sendRequestToSelf (const DtSetDataRequest &request) const |
| Helper function that sends given set data request to ourself. | |
Protected Attributes | |
| DtVrfObject * | myControlPoint |
| This is looked up once per tick - assumed unchanging while we have control. | |
| DtVector | myLocalDestination |
| DtVector | myWorldDestination |
| DtVector | myDestinationVector |
| bool | myDestinationVectorIsValid |
| bool | myAtDestination |
| double | myDistanceSquared |
| DtVrfAggregateStateRepository * | myAggregateStateRepository |
| DtAggregatedMoveToPSR * | myProcessState |
| Container for state data associated with this component. | |
| DtAggregatedMoveToDescriptor * | myAggregatedMoveToDescriptor |
| DtSetDataManager * | mySetDataManager |
| Pointer to aggregate's DtSetDataManager, cached in this class for convenience. | |
Ports and Port Groups | |
| DtAnalogOutputPort * | myMovementDirectionOutputPort |
| Output Port Name: desired-movement-direction Output Port Description: Specifies the current movement direction in radians Output Port Range: Output Group Parent: . | |
| DtAnalogOutputPort * | mySpeedOutputPort |
| Output Port Name: desired-speed Output Port Description: Specifies the current speed of the entity in meters/second Output Port Range: Output Group Parent: . | |
| DtOutputPortGroup * | myOutputPortGroup |
| Output Group Name: movement-control . | |
| DtVectorOutputPort * | myDestinationOutputPort |
| Output Port Name: destination Output Port Description: Specifies the current destination of the entity in geocentric coordinates. | |
Private Member Functions | |
| DtAggregatedMoveToController () | |
| Not Implemented. | |
| DtAggregatedMoveToController (const DtAggregatedMoveToController &orig) | |
| Not Implemented. | |
| DtAggregatedMoveToController & | operator= (const DtAggregatedMoveToController &orig) |
| Not Implemented. | |
DtHumanMoveAlongController is a controller that models movement to a <location> or <waypoint> for aggregated entities.
It also handles move into formation (at a location) and turn to heading (at the current location) tasks.
Developer Description: DtHumanMoveAlongController models move-to behavior for individual humans. It generates speed and heading controls that direct the entity to to its destination at the entity's current ordered speed. It responds to DtMoveToType, DtMoveToLocationTaskType, DtMoveIntoFormationTaskType and DtTurnToHeadingTask tasks. Component OPD Name: "aggregated-move-to-controller"
Uses Descriptor Type: DtAggregatedMoveToControllerDescriptor
Not Implemented.
| DtAggregatedMoveToController::DtAggregatedMoveToController | ( | const DtAggregatedMoveToController & | orig | ) | [private] |
Not Implemented.
| DtAggregatedMoveToController::DtAggregatedMoveToController | ( | const DtString & | name, |
| DtVrfObject * | owner, | ||
| DtSimManager * | simManager, | ||
| DtComponentDescriptor * | desc = 0, |
||
| DtReaderWriterRegistry * | parentRegistry = 0 |
||
| ) |
Constructor.
| virtual DtAggregatedMoveToController::~DtAggregatedMoveToController | ( | ) | [virtual] |
Destructor.
| DtAggregatedMoveToController& DtAggregatedMoveToController::operator= | ( | const DtAggregatedMoveToController & | orig | ) | [private] |
Not Implemented.
| virtual bool DtAggregatedMoveToController::init | ( | ) | [virtual] |
Init. Call immediately after construction.
Reimplemented from DtControllerComponent.
| virtual DtString DtAggregatedMoveToController::type | ( | ) | const [virtual] |
Implements DtTaskControllerComponent.
| virtual void DtAggregatedMoveToController::tick | ( | ) | [virtual] |
This components simulation tick.
Reimplemented from DtSimComponent.
| static void DtAggregatedMoveToController::moveToCallback | ( | DtSimMessage * | msg, |
| void * | usr | ||
| ) | [static] |
Callback function that handles DtMoveToType tasks.
Calls processMoveToTask().
| msg | Message containing DtMoveToTask. |
| usr | Pointer to an instance of this class. |
| static void DtAggregatedMoveToController::setLocationCallback | ( | DtSimMessage * | msg, |
| void * | usr | ||
| ) | [static] |
Callback function that handles DtSetLocationRequest set data requests.
Calls processSetLocation().
| msg | Message containing DtSetLocationRequest. |
| usr | Pointer to an instance of this class. |
| static void DtAggregatedMoveToController::moveToLocationCallback | ( | DtSimMessage * | msg, |
| void * | usr | ||
| ) | [static] |
Callback function that handles DtMoveToLocation tasks.
Calls processMoveToLocationTask().
| msg | Message containing DtMoveToLocationTask. |
| usr | Pointer to an instance of this class. |
| static void DtAggregatedMoveToController::moveIntoFormationCallback | ( | DtSimMessage * | msg, |
| void * | usr | ||
| ) | [static] |
Callback function that handles DtMoveIntoFormation tasks.
Calls processMoveIntoFormationTask().
| msg | Message containing DtMoveIntoFormationTask. |
| usr | Pointer to an instance of this class. |
| static void DtAggregatedMoveToController::turnToHeadingCallback | ( | DtSimMessage * | msg, |
| void * | usrData | ||
| ) | [static] |
Callback function that handles DtTurnToHeading tasks.
Calls processTurnToHeadingTask().
| msg | Message containing DtTurnToHeadingTask. |
| usr | Pointer to an instance of this class. |
| static DtSimComponent* DtAggregatedMoveToController::creator | ( | const DtString & | name, |
| DtVrfObject * | owner, | ||
| DtSimManager * | simManager, | ||
| DtComponentDescriptor * | desc = 0, |
||
| DtReaderWriterRegistry * | parentRegistry = 0 |
||
| ) | [static] |
Static creator function for factory registration.
| static void DtAggregatedMoveToController::modifyVrfObjectCallback | ( | DtSimMessage * | msg, |
| void * | usr | ||
| ) | [static] |
Calls processModifyVrfObject.
| virtual void DtAggregatedMoveToController::processMoveToTask | ( | DtSimMessage * | msg | ) | [protected, virtual] |
Sets world destination from the task.
| msg | Message containing a DtMoveToTask. |
| virtual void DtAggregatedMoveToController::processMoveToLocationTask | ( | DtSimMessage * | msg | ) | [protected, virtual] |
| virtual void DtAggregatedMoveToController::processDestinationChanged | ( | ) | [protected, virtual] |
Ensures that the destination stored in the ProcessStateRepository is consistent with the location of the destination control point.
Intended to be called only when the position of the control point has changed.
| virtual bool DtAggregatedMoveToController::setupDestination | ( | ) | [protected, virtual] |
Look up the control point by name and set the myControlPoint member to point to it.
Detects changes in the target point using myControlPointLastLocation and calls processWaypointChanged().
| virtual void DtAggregatedMoveToController::setupDestinationVector | ( | ) | const [protected, virtual] |
Sets up a vector from the current destination location to the entity's location to use in determining when/if the entity has passed its destination location.
This is done by subtracting the DtVector representing the destination's position from the one representing the entity’s position.
| virtual void DtAggregatedMoveToController::invalidateDestinationVector | ( | ) | const [protected, virtual] |
Tells the component that any cached destination vector should be recalculated.
| virtual bool DtAggregatedMoveToController::atDestination | ( | ) | [protected, virtual] |
Are we within the at-distance parameter to the destination? If the myDistanceSquared member calculated in tick() is less than or equal to the square of the value provided in the at-distance parameter of the DtGroundMoveToDescriptor, atDestination() sets myAtDestination to true.
If the myDistanceSquared !<= at-distance, atDestination() sets myAtDestination to false. myAtDestination is returned to the calling function.
| virtual void DtAggregatedMoveToController::doMoving | ( | ) | [protected, virtual] |
Calls findDesiredHeading() and then sets port values based on those results.
| virtual double DtAggregatedMoveToController::findDesiredHeading | ( | ) | [protected, virtual] |
Determines the desired heading.
| virtual void DtAggregatedMoveToController::moveToDestination | ( | ) | [protected, virtual] |
Attempts to move to the destination location. Override to provide movement functionality.
| virtual void DtAggregatedMoveToController::stop | ( | ) | [protected, virtual] |
Set port values for stopping, and mark the task complete.
| virtual void DtAggregatedMoveToController::registerTaskMsgCallbacks | ( | ) | [protected, virtual] |
Overridden to register interest in move to messages.
Reimplemented from DtTaskControllerComponent.
| virtual void DtAggregatedMoveToController::processModifyVrfObject | ( | DtSimMessage * | msg | ) | [protected, virtual] |
Resets the destination vector when the location of the entity to which this controller is attached is changed through a DtIfModifyVrfObject message (i.e.
a drag & drop in the front-end).
| virtual void DtAggregatedMoveToController::processSetLocation | ( | DtSimMessage * | msg | ) | [protected, virtual] |
Resets the destination vector when the location of the entity to which this controller is attached is changed through a set location request.
| virtual bool DtAggregatedMoveToController::createPortGroups | ( | ) | [protected, virtual] |
Creates and initializes port groups.
Reimplemented from DtSimComponent.
| virtual bool DtAggregatedMoveToController::createPorts | ( | ) | [protected, virtual] |
Creates myDestinationOutputPort.
Reimplemented from DtSimComponent.
| virtual bool DtAggregatedMoveToController::createPSR | ( | ) | [protected, 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 double DtAggregatedMoveToController::distanceToDestination | ( | ) | const [protected, virtual] |
| virtual void DtAggregatedMoveToController::clearTask | ( | ) | [protected, virtual] |
Override to deactivate myHumanMovementControlOutputPortGroup.
Reimplemented from DtSingleTaskControllerComponent.
| virtual double DtAggregatedMoveToController::atDistance | ( | ) | const [protected, virtual] |
Maximum distance at which entity is considered to be 'at' goal.
Returns value stored in descriptor (if it exists), otherwise returns 10..
| virtual void DtAggregatedMoveToController::processMoveIntoFormationTask | ( | DtSimMessage * | msg | ) | [protected, virtual] |
Implements turn to heading task by sending a set location and set heading request to ourself.
| msg | Message containing a DtMoveIntoFormationTask. |
| virtual void DtAggregatedMoveToController::processTurnToHeadingTask | ( | DtSimMessage * | msg | ) | [protected, virtual] |
Implements turn to heading task by sending a set heading request to ourself.
| msg | Message containing a DtTurnToHeadingTask. |
| virtual void DtAggregatedMoveToController::sendRequestToSelf | ( | const DtSetDataRequest & | request | ) | const [protected, virtual] |
Helper function that sends given set data request to ourself.
Output Port Name: desired-movement-direction
Output Port Description: Specifies the current movement direction in radians Output Port Range:
Output Group Parent:
.
Output Port Name: desired-speed
Output Port Description: Specifies the current speed of the entity in meters/second Output Port Range:
Output Group Parent:
.
Output Group Name: movement-control
.
Output Port Name: destination
Output Port Description: Specifies the current destination of the entity in geocentric coordinates.
Output Port Range:
Output Group Parent:
DtVrfObject* DtAggregatedMoveToController::myControlPoint [protected] |
This is looked up once per tick - assumed unchanging while we have control.
DtVector DtAggregatedMoveToController::myDestinationVector [mutable, protected] |
bool DtAggregatedMoveToController::myDestinationVectorIsValid [mutable, protected] |
bool DtAggregatedMoveToController::myAtDestination [protected] |
double DtAggregatedMoveToController::myDistanceSquared [protected] |
Container for state data associated with this component.
This state is saved and restored as part of a scenario (or checkpoint).
DtAggregatedMoveToDescriptor* DtAggregatedMoveToController::myAggregatedMoveToDescriptor [protected] |
Pointer to aggregate's DtSetDataManager, cached in this class for convenience.