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

DtGroundMoveToControllerComponent is a controller that models movement to a waypoint for ground entities. More...

Inheritance diagram for DtGroundMoveToControllerComponent:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 DtGroundMoveToControllerComponent (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=NULL, DtReaderWriterRegistry *parentRegistry=NULL)
 (const DtString&,DtVrfObject*,DtSimManager*,
virtual ~DtGroundMoveToControllerComponent ()
 destructor
virtual DtString type () const
 Returns a string identifies the class type of component.
virtual void processMoveToTask (DtSimMessage *msg)
virtual void processDestinationChanged ()
 Ensures that the destination stored in the ProcessStateRepository is consistent with the location of the destination control point.
virtual void registerTaskMsgCallbacks ()
 Overridden to register interest in move to messages.
virtual bool setupDestination ()
 Look up the control point by name and set the myControlPoint member to point to it.

Static Public Member Functions

static void moveToCallback (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 Attributes

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

Private Member Functions

 DtGroundMoveToControllerComponent ()
 Default constructor; should not be called.
 DtGroundMoveToControllerComponent (const DtGroundMoveToControllerComponent &orig)
 copy constructor; shallow; does not copy the ports.
const
DtGroundMoveToControllerComponent
operator= (const DtGroundMoveToControllerComponent &orig)
 assignment operator; see comments on copy constructor!

Detailed Description

DtGroundMoveToControllerComponent is a controller that models movement to a waypoint for ground entities.

Developer Description: DtGroundMoveToControllerComponent is derived from the DtGroundMoveToDestinationControllerComponent and adds the ability to move towards a control point. It's responsibility is to ensure that the destination is always in sync with the control point, which includes responding to the appropriate messages.

Uses Descriptor Type: DtGroundMoveToDescriptor

Examples

Constructor & Destructor Documentation

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

(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:
DtGroundAutoMoveToType

Reimplemented from DtGroundMoveToDestinationControllerComponent.

Reimplemented in DtGroundPatrolBetweenController.

static void DtGroundMoveToControllerComponent::moveToCallback ( 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.

Reimplemented in DerivedMoveToController.

Ensures that the destination stored in the ProcessStateRepository is consistent with the location of the destination control point.

Intended to be called only when the position of the control point has changed.

Note:
Also invalidates the destination vector as the world position has changed.
static DtSimComponent* DtGroundMoveToControllerComponent::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.

Reimplemented in DtGroundPatrolBetweenController, and DerivedMoveToController.

Overridden to register interest in move to messages.

Reimplemented from DtGroundMoveToDestinationControllerComponent.

Reimplemented in DtGroundPatrolBetweenController.

Look up the control point by name and set the myControlPoint member to point to it.

Detects changes in the target point using myControlPointLastLocation and calls processWaypointChanged().

Reimplemented from DtGroundMoveToDestinationControllerComponent.

const DtGroundMoveToControllerComponent& DtGroundMoveToControllerComponent::operator= ( const DtGroundMoveToControllerComponent orig) [private]

assignment operator; see comments on copy constructor!


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)