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

DtMissileMoveToControllerComponent is a controller that maneuvers a missile toward a given target point. More...

Inheritance diagram for DtMissileMoveToControllerComponent:
Inheritance graph
[legend]

List of all members.

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 DtVectortargetPoint () const
virtual void setTargetVelocity (const DtVector &arg)
 Set the current target velocity for the missile.
virtual const DtVectortargetVelocity () 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 DtSimComponentcreator (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

Detailed Description

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


Constructor & Destructor Documentation

(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 void DtMissileMoveToControllerComponent::tick ( ) [virtual]

Calculate new control values.

Reimplemented from DtSimComponent.

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:
DtMissileMoveToType

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 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.

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

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 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.

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.


Member Data Documentation

This is looked up once per tick - assumed unchanging while we have control.


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)