![]() |
VR-Forces 4.0.4 Class Documentation
|
DtMissileMoveToControllerComponent is a controller that maneuvers a missile toward a given target point. More...

Public Member Functions | |
| DtMissileMoveToControllerComponent (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0) | |
| (const DtString&,DtVrfObject*,DtSimManager*, | |
| virtual | ~DtMissileMoveToControllerComponent () |
| destructor | |
| virtual void | tick () |
| Calculate new control values. | |
| virtual DtString | type () const |
| Returns a string identifies the class type of component. | |
| virtual void | setTargetPoint (const DtVector &targetPoint) |
| Sets the target point location. | |
| virtual const DtVector & | targetPoint () const |
| virtual void | setTargetVelocity (const DtVector &arg) |
| Set the current target velocity for the missile. | |
| virtual const DtVector & | targetVelocity () const |
| virtual void | calculateSteering (const DtVector &relativeVelocity, const DtVector &localPosition, const DtVector &targetVelocity, const DtVector &targetPoint, double &maneuverAccelXOut, double &maneuverAccelYOut, double &maneuverAccelZOut) |
| Just calls down to calculateSteeringToPoint (ignoring targetVelocity). | |
| virtual void | processTargetPointTask (DtSimMessage *msg) |
| This function calls setTargetPoint(), passing in the location of target point given in the target-point message. | |
Static Public Member Functions | |
| static void | targetPointCallback (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 | |
| DtMissileMoveToControllerComponent () | |
| Default constructor; should not be called. | |
| DtMissileMoveToControllerComponent (const DtMissileMoveToControllerComponent &orig) | |
| copy constructor; shallow; does not copy the ports. | |
| const DtMissileMoveToControllerComponent & | operator= (const DtMissileMoveToControllerComponent &orig) |
| assignment operator; see comments on copy constructor! | |
| virtual void | registerTaskMsgCallbacks () |
| Overrides this so it can register its interest in MoveTo commands. | |
| virtual bool | setupControlPoint () |
| Returns the boolean member data flag myMissilesTargeted, indicating whether or not a target location has been set for the missile. | |
| virtual double | findDesiredSpeed () |
| Returns the maximum speed for the missile. | |
| virtual void | doMoving () |
| Calculates and sets the maneuver and thrust port values for this frame. | |
Protected Attributes | |
| double | myDesiredSpeed |
| This is looked up once per tick - assumed unchanging while we have control. | |
| double | myCurrentSpeed |
DtMissileMoveToControllerComponent is a controller that maneuvers a missile toward a given target point.
End User Description: It registers for DtTargetPointType messages, through which it receives its target location. It generates thrust and steering outputs.
Uses Descriptor Type: DtComponentDescriptor
| DtMissileMoveToControllerComponent::DtMissileMoveToControllerComponent | ( | 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 DtMissileMoveToControllerComponent::~DtMissileMoveToControllerComponent | ( | ) | [virtual] |
destructor
Default constructor; should not be called.
Here because the compiler will generate an unprotected one otherwise.
| DtMissileMoveToControllerComponent::DtMissileMoveToControllerComponent | ( | const DtMissileMoveToControllerComponent & | orig | ) | [protected] |
copy constructor; shallow; does not copy the ports.
| virtual void DtMissileMoveToControllerComponent::tick | ( | ) | [virtual] |
Calculate new control values.
Reimplemented from DtSimComponent.
| virtual DtString DtMissileMoveToControllerComponent::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 DtMissileControllerComponent.
Reimplemented in DtMissileTrackEntityController, and DtLasingMissileTrackController.
| virtual void DtMissileMoveToControllerComponent::setTargetPoint | ( | const DtVector & | targetPoint | ) | [virtual] |
Sets the target point location.
It also calculates and sets myDistanceToTarget.
| virtual const DtVector& DtMissileMoveToControllerComponent::targetPoint | ( | ) | const [virtual] |
| virtual void DtMissileMoveToControllerComponent::setTargetVelocity | ( | const DtVector & | arg | ) | [virtual] |
Set the current target velocity for the missile.
| virtual const DtVector& DtMissileMoveToControllerComponent::targetVelocity | ( | ) | const [virtual] |
| virtual void DtMissileMoveToControllerComponent::calculateSteering | ( | const DtVector & | relativeVelocity, |
| const DtVector & | localPosition, | ||
| const DtVector & | targetVelocity, | ||
| const DtVector & | targetPoint, | ||
| double & | maneuverAccelXOut, | ||
| double & | maneuverAccelYOut, | ||
| double & | maneuverAccelZOut | ||
| ) | [virtual] |
Just calls down to calculateSteeringToPoint (ignoring targetVelocity).
Implements DtMissileControllerComponent.
Reimplemented in DtMissileTrackEntityController.
| static void DtMissileMoveToControllerComponent::targetPointCallback | ( | 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 DtMissileMoveToControllerComponent::processTargetPointTask | ( | DtSimMessage * | msg | ) | [virtual] |
This function calls setTargetPoint(), passing in the location of target point given in the target-point message.
| static DtSimComponent* DtMissileMoveToControllerComponent::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 in DtLasingMissileTrackController, and DtMissileTrackEntityController.
| const DtMissileMoveToControllerComponent& DtMissileMoveToControllerComponent::operator= | ( | const DtMissileMoveToControllerComponent & | orig | ) | [protected] |
assignment operator; see comments on copy constructor!
| virtual void DtMissileMoveToControllerComponent::registerTaskMsgCallbacks | ( | ) | [protected, virtual] |
Overrides this so it can register its interest in MoveTo commands.
Reimplemented from DtTaskControllerComponent.
Reimplemented in DtMissileTrackEntityController.
| virtual bool DtMissileMoveToControllerComponent::setupControlPoint | ( | ) | [protected, virtual] |
Returns the boolean member data flag myMissilesTargeted, indicating whether or not a target location has been set for the missile.
Reimplemented in DtMissileTrackEntityController, and DtLasingMissileTrackController.
| virtual double DtMissileMoveToControllerComponent::findDesiredSpeed | ( | ) | [protected, virtual] |
Returns the maximum speed for the missile.
Reimplemented in DtMissileTrackEntityController.
| virtual void DtMissileMoveToControllerComponent::doMoving | ( | ) | [protected, virtual] |
Calculates and sets the maneuver and thrust port values for this frame.
It takes the frame duration dT as an argument. To calculate maneuver acceleration, it calls calculateSteering(). For thrust, it first calls desiredSpeed() to get the appropriate speed for the missile, and then calls approximateThrust(), passing in the desired speed as a parameter.
double DtMissileMoveToControllerComponent::myDesiredSpeed [protected] |
This is looked up once per tick - assumed unchanging while we have control.
double DtMissileMoveToControllerComponent::myCurrentSpeed [protected] |