VR-Forces 4.0.4 Class Documentation
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
DtMissileTrackEntityController Class Reference

DtMissileTrackEntityController is a controller that models entity tracking behavior for missile entities. More...

Inheritance diagram for DtMissileTrackEntityController:
Inheritance graph
[legend]

List of all members.

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 DtStringtargetEntity () 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 DtSimComponentcreator (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

DtVrfObjectmyEntityPointer
 Set fresh each frame by setupControlPoint.

Detailed Description

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


Constructor & Destructor Documentation

DtMissileTrackEntityController::DtMissileTrackEntityController ( const DtString name,
DtVrfObject owner,
DtSimManager simManager,
DtComponentDescriptor desc = 0,
DtReaderWriterRegistry parentRegistry = 0 
)

(const DtString&,DtVrfObject*,DtSimManager*,

Parameters:
nameReader writer name of this component.
ownerThe DtVrfObject that owns this component
simManagerThe simulation manager (provides access to terrain, message interface, simulation clock).
descThe component descriptor used to initialize this component.
parentRegistryPointer to the parent reader writer registry (the containing object that reads/writes this object).
(const DtString&,DtVrfObject*,DtSimManager*, DtComponentDescriptor*,DtReaderWriterRegistry* parentRegistry)

destructor

Default constructor; should not be called.

Here because the compiler will generate an unprotected one otherwise.

copy constructor; shallow; does not copy the ports.


Member Function Documentation

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.

Returns:
DtMissileTrackEntityType

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]

Launch phase is dependent on if the missile is within target aquisition range.

See DtMissileFlightPSR for more information.

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.

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*,

Parameters:
nameReader writer name of this component.
ownerThe DtVrfObject that owns this component
simManagerThe simulation manager (provides access to terrain, message interface, simulation clock).
descThe component descriptor used to initialize this component.
parentRegistryPointer to the parent reader writer registry (the containing object that reads/writes this object).
(const DtString&,DtVrfObject*,DtSimManager*, DtComponentDescriptor*,DtReaderWriterRegistry* parentRegistry)

Returns:
New instance of this class.

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.


Member Data Documentation

Set fresh each frame by setupControlPoint.


The documentation for this class was generated from the following file:

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)