![]() |
VR-Forces 4.0.4 Class Documentation
|
DtGroundInterceptAndDestroyController is a controller that models moving to intercept and destroy a given target. More...

Public Member Functions | |
| DtGroundInterceptAndDestroyController (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0) | |
| (const DtString&,DtVrfObject*,DtSimManager*, | |
| virtual | ~DtGroundInterceptAndDestroyController () |
| destructor | |
| virtual DtString | type () const |
| Returns a string identifies the class type of component. | |
| virtual void | processInterceptAndDestroyTask (DtSimMessage *msg) |
| virtual const DtString & | entityToInterceptAndDestroy () |
| What entity are we attempting to intercept and destroy? This accessor has the side effect of setting myProcessState->myEntityToInterceptAndDestroy to DtString::nullString(), if the entity is not tasked and myEntityToInterceptAndDestroy is not already the null string. | |
| virtual void | setEntityToInterceptAndDestroy (const DtString &entity) |
| 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 void | moveToDestination () |
| Attempts to move to the destination location. Override to provide movement functionality. | |
| virtual bool | nearDestination () |
| Override to use the standOffDistance the user specified in the intercept and destroy task. | |
| virtual bool | atDestination () |
| Override to use the standOffDistance the user specified in the intercept and destroy task. | |
| 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 target entity. | |
Static Public Member Functions | |
| static void | interceptAndDestroyCallback (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 | |
| DtGroundInterceptAndDestroyController () | |
| Default constructor; should not be called. | |
| DtGroundInterceptAndDestroyController (const DtGroundInterceptAndDestroyController &orig) | |
| copy constructor; shallow; does not copy the ports. | |
| const DtGroundInterceptAndDestroyController & | operator= (const DtGroundInterceptAndDestroyController &orig) |
| assignment operator; see comments on copy constructor! | |
| bool | createPorts () |
| Overridden to create the automotive ports. | |
Protected Attributes | |
| DtVrfObject * | myTargetp |
| Set fresh each frame by setupControlPoint. | |
| DtStringOutputPort * | myInterceptAndDestroyOutputPort |
| double | myCurrentSeperation |
| double | myTargetBR |
| Bounding radius of target's bounding volume. | |
| bool | myFirstTick |
DtGroundInterceptAndDestroyController is a controller that models moving to intercept and destroy a given target.
Developer Description: Each simulation frame the destination to which the entity moves is recalculated to be in the right place with respect to intercepting the target entity.
Uses Descriptor Type: DtGroundMoveToDescriptor
| DtGroundInterceptAndDestroyController::DtGroundInterceptAndDestroyController | ( | 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 DtGroundInterceptAndDestroyController::~DtGroundInterceptAndDestroyController | ( | ) | [virtual] |
destructor
Default constructor; should not be called.
Here because the compiler will generate an unprotected one otherwise.
| DtGroundInterceptAndDestroyController::DtGroundInterceptAndDestroyController | ( | const DtGroundInterceptAndDestroyController & | orig | ) | [protected] |
copy constructor; shallow; does not copy the ports.
| virtual DtString DtGroundInterceptAndDestroyController::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 DtGroundInterceptAndDestroyController::interceptAndDestroyCallback | ( | 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 DtGroundInterceptAndDestroyController::processInterceptAndDestroyTask | ( | DtSimMessage * | msg | ) | [virtual] |
| virtual const DtString& DtGroundInterceptAndDestroyController::entityToInterceptAndDestroy | ( | ) | [virtual] |
What entity are we attempting to intercept and destroy? This accessor has the side effect of setting myProcessState->myEntityToInterceptAndDestroy to DtString::nullString(), if the entity is not tasked and myEntityToInterceptAndDestroy is not already the null string.
| virtual void DtGroundInterceptAndDestroyController::setEntityToInterceptAndDestroy | ( | const DtString & | entity | ) | [virtual] |
| static DtSimComponent* DtGroundInterceptAndDestroyController::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 DtGroundInterceptAndDestroyController::registerTaskMsgCallbacks | ( | ) | [virtual] |
Overrides this so it can register its interest in followEntity commands.
Reimplemented from DtGroundMoveToDestinationControllerComponent.
| virtual bool DtGroundInterceptAndDestroyController::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 void DtGroundInterceptAndDestroyController::moveToDestination | ( | ) | [virtual] |
Attempts to move to the destination location. Override to provide movement functionality.
Reimplemented from DtGroundMoveToDestinationControllerComponent.
| virtual bool DtGroundInterceptAndDestroyController::nearDestination | ( | ) | [virtual] |
Override to use the standOffDistance the user specified in the intercept and destroy task.
Reimplemented from DtGroundMoveToDestinationControllerComponent.
| virtual bool DtGroundInterceptAndDestroyController::atDestination | ( | ) | [virtual] |
Override to use the standOffDistance the user specified in the intercept and destroy task.
Reimplemented from DtGroundMoveToDestinationControllerComponent.
| virtual bool DtGroundInterceptAndDestroyController::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 DtGroundInterceptAndDestroyController::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 DtGroundInterceptAndDestroyController::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 DtGroundInterceptAndDestroyController::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 DtGroundInterceptAndDestroyController::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 DtGroundInterceptAndDestroyController::stop | ( | ) | [virtual] |
Overrides so we don't complete the task when we're at the right location with regard to the target entity.
Simply calls DtGroundMoveToControllerComponent::doMoving().
Reimplemented from DtGroundMoveToDestinationControllerComponent.
| const DtGroundInterceptAndDestroyController& DtGroundInterceptAndDestroyController::operator= | ( | const DtGroundInterceptAndDestroyController & | orig | ) | [protected] |
assignment operator; see comments on copy constructor!
| bool DtGroundInterceptAndDestroyController::createPorts | ( | ) | [protected, virtual] |
Overridden to create the automotive ports.
Reimplemented from DtGroundMoveToDestinationControllerComponent.
Set fresh each frame by setupControlPoint.
DtStringOutputPort* DtGroundInterceptAndDestroyController::myInterceptAndDestroyOutputPort [protected] |
double DtGroundInterceptAndDestroyController::myCurrentSeperation [protected] |
double DtGroundInterceptAndDestroyController::myTargetBR [protected] |
Bounding radius of target's bounding volume.
Used to ensure we don't occupy same space as our target.