![]() |
VR-Forces 4.0.4 Class Documentation
|
DtGroundFollowEntityController is a controller that models following behavior for ground vehicles. More...

Public Member Functions | |
| DtGroundFollowEntityController (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0) | |
| (const DtString&,DtVrfObject*,DtSimManager*, | |
| virtual | ~DtGroundFollowEntityController () |
| destructor | |
| virtual DtString | type () const |
| Returns a string identifies the class type of component. | |
| virtual void | processFollowEntityTask (DtSimMessage *msg) |
| virtual const DtString & | entityToFollow () |
| What entity are we following? This accessor has the side effect of setting myProcessState->myEntityToFollow to DtString::nullString(), if the entity is not tasked and myEntityToFollow is not already the null string. | |
| virtual void | setEntityToFollow (const DtString &entity) |
| virtual const DtVector & | offsetVector () const |
| The offset from the entity's position to follow at, in entity coordinates. | |
| virtual void | setOffsetVector (const DtVector &offsets) |
| virtual void | registerTaskMsgCallbacks () |
| Overrides this so it can register its interest in followEntity commands. | |
| virtual bool | setupDestination () |
| Sets the world destination in the process state repository to the location of the entity we're following plus the indicated offset and then calls down to the base class. | |
| virtual bool | passedDestination () |
| Overrides to force the entity to be near the destination as well as across the 'destination' line to be considered past the destination. | |
| virtual double | findDesiredSpeed () |
| Overrides so we can speed up when falling behind and slow down if we get past the position we're supposed to be in. | |
| virtual double | findDesiredHeading () |
| Overrides so the entity won't turn toward the destination point when it is close to or past the destination; rather, in these cases, it assumes the heading of the lead entity. | |
| virtual void | setupDestinationVector () const |
| Determine the destination vector for the entity out of the heading of the entity being followed. | |
| virtual DtAutoTransmissionGear | determineGearSetting () |
| Sets myProcessState->myCurrentGear to DtAutoGearReverse or DtAutoGearForward based on dot product of the followed entity's velocity vector and it's heading vector. | |
| virtual void | stop () |
| Overrides so we don't complete the task when we're at the right location with regard to the followed entity. | |
Static Public Member Functions | |
| static void | followEntityCallback (DtSimMessage *msg, void *usrData) |
| Instances of this component will register this callback with their own 'this' pointer as user data with the msg executive requesting notification of move-to tasks. | |
| static DtSimComponent * | creator (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0) |
| (const DtString&,DtVrfObject*,DtSimManager*, | |
Protected Member Functions | |
| DtGroundFollowEntityController () | |
| Default constructor; should not be called. | |
| DtGroundFollowEntityController (const DtGroundFollowEntityController &orig) | |
| copy constructor; shallow; does not copy the ports. | |
| const DtGroundFollowEntityController & | operator= (const DtGroundFollowEntityController &orig) |
| assignment operator; see comments on copy constructor! | |
| bool | createPorts () |
| Overridden to create the automotive ports. | |
Protected Attributes | |
| DtVrfObject * | myEntityPointer |
| Set fresh each frame by setupDestination() | |
| DtStringOutputPort * | myFollowEntityOutputPort |
DtGroundFollowEntityController is a controller that models following behavior for ground vehicles.
Developer Description: Each simulation frame the destination to which the entity moves is recalculated to be in the right place with respect to the followed entity.
Uses Descriptor Type: DtGroundMoveToDescriptor
| DtGroundFollowEntityController::DtGroundFollowEntityController | ( | 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 DtGroundFollowEntityController::~DtGroundFollowEntityController | ( | ) | [virtual] |
destructor
| DtGroundFollowEntityController::DtGroundFollowEntityController | ( | ) | [protected] |
Default constructor; should not be called.
Here because the compiler will generate an unprotected one otherwise.
| DtGroundFollowEntityController::DtGroundFollowEntityController | ( | const DtGroundFollowEntityController & | orig | ) | [protected] |
copy constructor; shallow; does not copy the ports.
| virtual DtString DtGroundFollowEntityController::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 DtGroundMoveToDestinationControllerComponent.
| static void DtGroundFollowEntityController::followEntityCallback | ( | DtSimMessage * | msg, |
| void * | usrData | ||
| ) | [static] |
Instances of this component will register this callback with their own 'this' pointer as user data with the msg executive requesting notification of move-to tasks.
| virtual void DtGroundFollowEntityController::processFollowEntityTask | ( | DtSimMessage * | msg | ) | [virtual] |
| virtual const DtString& DtGroundFollowEntityController::entityToFollow | ( | ) | [virtual] |
What entity are we following? This accessor has the side effect of setting myProcessState->myEntityToFollow to DtString::nullString(), if the entity is not tasked and myEntityToFollow is not already the null string.
| virtual void DtGroundFollowEntityController::setEntityToFollow | ( | const DtString & | entity | ) | [virtual] |
| virtual const DtVector& DtGroundFollowEntityController::offsetVector | ( | ) | const [virtual] |
The offset from the entity's position to follow at, in entity coordinates.
This comes from the follow task message.
| virtual void DtGroundFollowEntityController::setOffsetVector | ( | const DtVector & | offsets | ) | [virtual] |
| static DtSimComponent* DtGroundFollowEntityController::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). |
Reimplemented from DtGroundMoveToDestinationControllerComponent.
| virtual void DtGroundFollowEntityController::registerTaskMsgCallbacks | ( | ) | [virtual] |
Overrides this so it can register its interest in followEntity commands.
Reimplemented from DtGroundMoveToDestinationControllerComponent.
| virtual bool DtGroundFollowEntityController::setupDestination | ( | ) | [virtual] |
Sets the world destination in the process state repository to the location of the entity we're following plus the indicated offset and then calls down to the base class.
Reimplemented from DtGroundMoveToDestinationControllerComponent.
| virtual bool DtGroundFollowEntityController::passedDestination | ( | ) | [virtual] |
Overrides to force the entity to be near the destination as well as across the 'destination' line to be considered past the destination.
Reimplemented from DtGroundMoveToDestinationControllerComponent.
| virtual double DtGroundFollowEntityController::findDesiredSpeed | ( | ) | [virtual] |
Overrides so we can speed up when falling behind and slow down if we get past the position we're supposed to be in.
Reimplemented from DtGroundMoveToDestinationControllerComponent.
| virtual double DtGroundFollowEntityController::findDesiredHeading | ( | ) | [virtual] |
Overrides so the entity won't turn toward the destination point when it is close to or past the destination; rather, in these cases, it assumes the heading of the lead entity.
Reimplemented from DtGroundMoveToDestinationControllerComponent.
| virtual void DtGroundFollowEntityController::setupDestinationVector | ( | ) | const [virtual] |
Determine the destination vector for the entity out of the heading of the entity being followed.
Converts the heading into topo coordinates, creates a topo destination vector, and then converts that to the entity's local coordinate system. This is used by the entity to determine if it has passed it's destination which is the entity being followed, including the specified offset.
Reimplemented from DtGroundMoveToDestinationControllerComponent.
| virtual DtAutoTransmissionGear DtGroundFollowEntityController::determineGearSetting | ( | ) | [virtual] |
Sets myProcessState->myCurrentGear to DtAutoGearReverse or DtAutoGearForward based on dot product of the followed entity's velocity vector and it's heading vector.
If the followed entity is not moving, then gear is the same as the previous frame.
Reimplemented from DtGroundMoveToDestinationControllerComponent.
| virtual void DtGroundFollowEntityController::stop | ( | ) | [virtual] |
Overrides so we don't complete the task when we're at the right location with regard to the followed entity.
Simply calls DtGroundMoveToControllerComponent::doMoving().
Reimplemented from DtGroundMoveToDestinationControllerComponent.
| const DtGroundFollowEntityController& DtGroundFollowEntityController::operator= | ( | const DtGroundFollowEntityController & | orig | ) | [protected] |
assignment operator; see comments on copy constructor!
| bool DtGroundFollowEntityController::createPorts | ( | ) | [protected, virtual] |
Overridden to create the automotive ports.
Reimplemented from DtGroundMoveToDestinationControllerComponent.
Set fresh each frame by setupDestination()