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

DtGroundInterceptAndDestroyController is a controller that models moving to intercept and destroy a given target. More...

Inheritance diagram for DtGroundInterceptAndDestroyController:
Inheritance graph
[legend]

List of all members.

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

DtVrfObjectmyTargetp
 Set fresh each frame by setupControlPoint.
DtStringOutputPortmyInterceptAndDestroyOutputPort
double myCurrentSeperation
double myTargetBR
 Bounding radius of target's bounding volume.
bool myFirstTick

Detailed Description

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


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

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

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.

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.

static DtSimComponent* DtGroundInterceptAndDestroyController::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 DtGroundMoveToDestinationControllerComponent.

Overrides this so it can register its interest in followEntity commands.

Reimplemented from DtGroundMoveToDestinationControllerComponent.

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.

Attempts to move to the destination location. Override to provide movement functionality.

Reimplemented from DtGroundMoveToDestinationControllerComponent.

Override to use the standOffDistance the user specified in the intercept and destroy task.

Reimplemented from DtGroundMoveToDestinationControllerComponent.

Override to use the standOffDistance the user specified in the intercept and destroy task.

Reimplemented from DtGroundMoveToDestinationControllerComponent.

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.

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.

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.

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.

Note:
this function is not currently used.
Assumes that the entity pointer member, the sim manager, the terrain database in the sim manager, and the coordinate system object in the terrain database are all non-NULL.

Reimplemented from DtGroundMoveToDestinationControllerComponent.

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!

Overridden to create the automotive ports.

Reimplemented from DtGroundMoveToDestinationControllerComponent.


Member Data Documentation

Set fresh each frame by setupControlPoint.

Bounding radius of target's bounding volume.

Used to ensure we don't occupy same space as our target.


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)