![]() |
VR-Forces 4.0.4 Class Documentation
|
DtMissileTrackEntityController is a controller that models entity tracking behavior for missile entities. More...

Public Member Functions | |
| DtMissileTrackEntityController (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0) | |
| (const DtString&,DtVrfObject*,DtSimManager*, | |
| virtual | ~DtMissileTrackEntityController () |
| destructor | |
| virtual DtString | type () const |
| Returns a string identifies the class type of component. | |
| virtual void | setTargetEntity (const DtString &entity) |
| When setTargetEntity is called it will call setUpControlPoint to update where the missile should be flying to. | |
| virtual const DtString & | targetEntity () const |
| virtual DtMissileLaunchPhase | launchPhase () const |
| Launch phase is dependent on if the missile is within target aquisition range. | |
| virtual void | setLaunchPhase (DtMissileLaunchPhase phase) |
| virtual void | calculateSteering (const DtVector &relativeVelocity, const DtVector &localPosition, const DtVector &targetVelocity, const DtVector &targetPoint, double &maneuverAccelXOut, double &maneuverAccelYOut, double &maneuverAccelZOut) |
| Calls down to either calculateSteeringToPoint if launch phase is less than two or calculateSteeringToTarget, otherwise. | |
| virtual void | processTargetEntityTask (DtSimMessage *msg) |
| Calls setTargetEntity() with the string name of the target entity specified in the DtTargetEntityTask message. | |
Static Public Member Functions | |
| static void | targetEntityCallback (DtSimMessage *msg, void *usr) |
| 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 | |
| DtMissileTrackEntityController () | |
| Default constructor; should not be called. | |
| DtMissileTrackEntityController (const DtMissileTrackEntityController &orig) | |
| copy constructor; shallow; does not copy the ports. | |
| const DtMissileTrackEntityController & | operator= (const DtMissileTrackEntityController &orig) |
| assignment operator; see comments on copy constructor! | |
| virtual void | registerTaskMsgCallbacks () |
| Registers the callback targetEntityCallback() for handling DtTargetEntityTask messages. | |
| virtual bool | setupControlPoint () |
| Determines the target location the missile should be maneuvered toward. | |
| virtual double | findDesiredSpeed () |
| Returns the maximum speed of the missile. It is called by doMoving(). | |
Protected Attributes | |
| DtVrfObject * | myEntityPointer |
| Set fresh each frame by setupControlPoint. | |
DtMissileTrackEntityController is a controller that models entity tracking behavior for missile entities.
Developer Description: Each simulation frame the control point to which the entity moves is recalculated to be in the right place with respect to the tracked entity. The tracked entity is set by recieving a DtTargetEntityTask. The missile's state repository sends this message from it's setTarget function.
Uses Descriptor Type: DtComponentDescriptor
| DtMissileTrackEntityController::DtMissileTrackEntityController | ( | 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 DtMissileTrackEntityController::~DtMissileTrackEntityController | ( | ) | [virtual] |
destructor
| DtMissileTrackEntityController::DtMissileTrackEntityController | ( | ) | [protected] |
Default constructor; should not be called.
Here because the compiler will generate an unprotected one otherwise.
| DtMissileTrackEntityController::DtMissileTrackEntityController | ( | const DtMissileTrackEntityController & | orig | ) | [protected] |
copy constructor; shallow; does not copy the ports.
| virtual DtString DtMissileTrackEntityController::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 DtMissileMoveToControllerComponent.
| virtual void DtMissileTrackEntityController::setTargetEntity | ( | const DtString & | entity | ) | [virtual] |
When setTargetEntity is called it will call setUpControlPoint to update where the missile should be flying to.
| virtual const DtString& DtMissileTrackEntityController::targetEntity | ( | ) | const [virtual] |
| virtual DtMissileLaunchPhase DtMissileTrackEntityController::launchPhase | ( | ) | const [virtual] |
Launch phase is dependent on if the missile is within target aquisition range.
See DtMissileFlightPSR for more information.
| virtual void DtMissileTrackEntityController::setLaunchPhase | ( | DtMissileLaunchPhase | phase | ) | [virtual] |
| virtual void DtMissileTrackEntityController::calculateSteering | ( | const DtVector & | relativeVelocity, |
| const DtVector & | localPosition, | ||
| const DtVector & | targetVelocity, | ||
| const DtVector & | targetPoint, | ||
| double & | maneuverAccelXOut, | ||
| double & | maneuverAccelYOut, | ||
| double & | maneuverAccelZOut | ||
| ) | [virtual] |
Calls down to either calculateSteeringToPoint if launch phase is less than two or calculateSteeringToTarget, otherwise.
Reimplemented from DtMissileMoveToControllerComponent.
| static void DtMissileTrackEntityController::targetEntityCallback | ( | DtSimMessage * | msg, |
| void * | usr | ||
| ) | [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 DtMissileTrackEntityController::processTargetEntityTask | ( | DtSimMessage * | msg | ) | [virtual] |
Calls setTargetEntity() with the string name of the target entity specified in the DtTargetEntityTask message.
| static DtSimComponent* DtMissileTrackEntityController::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 DtMissileMoveToControllerComponent.
| const DtMissileTrackEntityController& DtMissileTrackEntityController::operator= | ( | const DtMissileTrackEntityController & | orig | ) | [protected] |
assignment operator; see comments on copy constructor!
| virtual void DtMissileTrackEntityController::registerTaskMsgCallbacks | ( | ) | [protected, virtual] |
Registers the callback targetEntityCallback() for handling DtTargetEntityTask messages.
Reimplemented from DtMissileMoveToControllerComponent.
| virtual bool DtMissileTrackEntityController::setupControlPoint | ( | ) | [protected, virtual] |
Determines the target location the missile should be maneuvered toward.
The target location is exactly the center of the target entity (rather than its projected location) plus the target error offset (a constant vector offset, calculated as a function of the CEP (circular error probable). Calls setTargetPoint() and setTargetVelocty() with the calculated target position and velocity, respectively. Also determines the appropriate launch phase using the current launch phase value and the missile's transition angle.
Reimplemented from DtMissileMoveToControllerComponent.
| virtual double DtMissileTrackEntityController::findDesiredSpeed | ( | ) | [protected, virtual] |
Returns the maximum speed of the missile. It is called by doMoving().
Reimplemented from DtMissileMoveToControllerComponent.
Set fresh each frame by setupControlPoint.