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

Public Member Functions | |
| DtHumanMoveToController (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0) | |
| Constructor. | |
| virtual | ~DtHumanMoveToController () |
| 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 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 bool | destinationIsInsideObstruction (const DtVector &localDestination) const |
| Returns whether or not current destination is inside an obstruction. | |
| virtual bool | decideToGiveUpTask () const |
| Checks to see if destination is inside an obstruction. | |
| virtual double | atDistance () const |
| Maximum distance at which entity is considered to be 'at' goal. | |
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 |
| DtHumanStateRepository * | myHumanStateRepository |
| DtHumanMoveToPSR * | myProcessState |
| Container for state data associated with this component. | |
| DtHumanMoveToControllerDescriptor * | myHumanMoveToControllerDescriptor |
Ports and Port Groups | |
| DtCollisionInputPort * | myCollisionAvoidancePort |
| Input Port Name: potential-collision-info Input Port Description: information about an impending potential collision with an entity or terrain vector data feature. | |
| DtInputPortGroup * | myCollisionAvoidancePortGroup |
| Input Port Group Name: collision-avoidance-control Input Port Group Description: | |
| DtHumanMovementControlOutputPortGroup * | myHumanMovementControlOutputPortGroup |
| Output Group Name: movement-control . | |
| DtVectorOutputPort * | myDestinationOutputPort |
| Output Port Name: destination Output Port Description: Specifies the current destination of the entity in geocentric coordiantes. | |
Private Member Functions | |
| DtHumanMoveToController () | |
| Not Implemented. | |
| DtHumanMoveToController (const DtHumanMoveToController &orig) | |
| Not Implemented. | |
| DtHumanMoveToController & | operator= (const DtHumanMoveToController &orig) |
| Not Implemented. | |
DtHumanMoveAlongController is a controller that models movement to a <location> or <waypoint> for individual human entities.
Developer Description: DtHumanMoveToController 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 and DtMoveToLocationTaskType tasks. Component OPD Name: "human-move-to-controller"
Uses Descriptor Type: DtHumanMoveToControllerDescriptor
| DtHumanMoveToController::DtHumanMoveToController | ( | ) | [private] |
Not Implemented.
| DtHumanMoveToController::DtHumanMoveToController | ( | const DtHumanMoveToController & | orig | ) | [private] |
Not Implemented.
| DtHumanMoveToController::DtHumanMoveToController | ( | const DtString & | name, |
| DtVrfObject * | owner, | ||
| DtSimManager * | simManager, | ||
| DtComponentDescriptor * | desc = 0, |
||
| DtReaderWriterRegistry * | parentRegistry = 0 |
||
| ) |
Constructor.
| virtual DtHumanMoveToController::~DtHumanMoveToController | ( | ) | [virtual] |
Destructor.
| DtHumanMoveToController& DtHumanMoveToController::operator= | ( | const DtHumanMoveToController & | orig | ) | [private] |
Not Implemented.
| virtual bool DtHumanMoveToController::init | ( | ) | [virtual] |
Init. Call immediately after construction.
Reimplemented from DtControllerComponent.
| virtual DtString DtHumanMoveToController::type | ( | ) | const [virtual] |
Implements DtTaskControllerComponent.
| virtual void DtHumanMoveToController::tick | ( | ) | [virtual] |
This components simulation tick.
Reimplemented from DtSimComponent.
| static void DtHumanMoveToController::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 DtHumanMoveToController::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 DtHumanMoveToController::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 DtSimComponent* DtHumanMoveToController::creator | ( | const DtString & | name, |
| DtVrfObject * | owner, | ||
| DtSimManager * | simManager, | ||
| DtComponentDescriptor * | desc = 0, |
||
| DtReaderWriterRegistry * | parentRegistry = 0 |
||
| ) | [static] |
Static creator function for factory registration.
| static void DtHumanMoveToController::modifyVrfObjectCallback | ( | DtSimMessage * | msg, |
| void * | usr | ||
| ) | [static] |
Calls processModifyVrfObject.
| virtual void DtHumanMoveToController::processMoveToTask | ( | DtSimMessage * | msg | ) | [protected, virtual] |
Sets world destination from the task.
| msg | Message containing a DtMoveToTask. |
| virtual void DtHumanMoveToController::processMoveToLocationTask | ( | DtSimMessage * | msg | ) | [protected, virtual] |
| virtual void DtHumanMoveToController::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 DtHumanMoveToController::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 DtHumanMoveToController::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 DtHumanMoveToController::invalidateDestinationVector | ( | ) | const [protected, virtual] |
Tells the component that any cached destination vector should be recalculated.
| virtual bool DtHumanMoveToController::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 DtHumanMoveToController::doMoving | ( | ) | [protected, virtual] |
Calls findDesiredHeading() and then sets port values based on those results.
| virtual double DtHumanMoveToController::findDesiredHeading | ( | ) | [protected, virtual] |
Determines the desired heading.
| virtual void DtHumanMoveToController::moveToDestination | ( | ) | [protected, virtual] |
Attempts to move to the destination location. Override to provide movement functionality.
| virtual void DtHumanMoveToController::stop | ( | ) | [protected, virtual] |
Set port values for stopping, and mark the task complete.
| virtual void DtHumanMoveToController::registerTaskMsgCallbacks | ( | ) | [protected, virtual] |
Overridden to register interest in move to messages.
Reimplemented from DtTaskControllerComponent.
| virtual void DtHumanMoveToController::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 DtHumanMoveToController::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 DtHumanMoveToController::createPortGroups | ( | ) | [protected, virtual] |
Creates and initializes port groups.
Reimplemented from DtSimComponent.
| virtual bool DtHumanMoveToController::createPorts | ( | ) | [protected, virtual] |
Creates myDestinationOutputPort.
Reimplemented from DtSimComponent.
| virtual bool DtHumanMoveToController::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 DtHumanMoveToController::distanceToDestination | ( | ) | const [protected, virtual] |
| virtual void DtHumanMoveToController::clearTask | ( | ) | [protected, virtual] |
Override to deactivate myHumanMovementControlOutputPortGroup.
Reimplemented from DtSingleTaskControllerComponent.
| virtual bool DtHumanMoveToController::destinationIsInsideObstruction | ( | const DtVector & | localDestination | ) | const [protected, virtual] |
Returns whether or not current destination is inside an obstruction.
| virtual bool DtHumanMoveToController::decideToGiveUpTask | ( | ) | const [protected, virtual] |
Checks to see if destination is inside an obstruction.
If it is, returns true. Returns false otheriwise.
Reimplemented from DtSingleTaskControllerComponent.
| virtual double DtHumanMoveToController::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 0.5.
Input Port Name: potential-collision-info
Input Port Description: information about an impending potential collision with an entity or terrain vector data feature.
Input Port Range:
Input Port Default Value:
Input Group Parent: collision-avoidance-control
Input Port Group Name: collision-avoidance-control
Input Port Group Description:
DtHumanMovementControlOutputPortGroup* DtHumanMoveToController::myHumanMovementControlOutputPortGroup [protected] |
Output Group Name: movement-control
.
Output Port Name: destination
Output Port Description: Specifies the current destination of the entity in geocentric coordiantes.
Output Port Range:
Output Group Parent:
DtVrfObject* DtHumanMoveToController::myControlPoint [protected] |
This is looked up once per tick - assumed unchanging while we have control.
DtVector DtHumanMoveToController::myLocalDestination [protected] |
DtVector DtHumanMoveToController::myWorldDestination [protected] |
DtVector DtHumanMoveToController::myDestinationVector [mutable, protected] |
bool DtHumanMoveToController::myDestinationVectorIsValid [mutable, protected] |
bool DtHumanMoveToController::myAtDestination [protected] |
double DtHumanMoveToController::myDistanceSquared [protected] |
DtHumanMoveToPSR* DtHumanMoveToController::myProcessState [protected] |
Container for state data associated with this component.
This state is saved and restored as part of a scenario (or checkpoint).
DtHumanMoveToControllerDescriptor* DtHumanMoveToController::myHumanMoveToControllerDescriptor [protected] |