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

DtFollowEntityTask represents a follow entity task for an entity to perform. More...

Inheritance diagram for DtFollowEntityTask:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 DtFollowEntityTask ()
 default constructor
 DtFollowEntityTask (const DtString &writeName, DtReaderWriterRegistry *parentRegistry=0)
 constructor If you have a task 'put' itself, the writeName will preface the task.
 DtFollowEntityTask (const DtString &writeName, const DtFollowEntityTask &orig, DtReaderWriterRegistry *parentRegistry=0)
 Copy constructor; nothing to be copied.
const DtFollowEntityTaskoperator= (const DtFollowEntityTask &orig)
 assignment operator
virtual ~DtFollowEntityTask ()
virtual int type () const
 Returns DtFollowEntityType.
virtual DtSimTaskclone (const DtString &name, DtReaderWriterRegistry *parentRegistry=0) const
 Creates a copy of this follow entity task.
virtual DtString stringRep () const
 Get a readable string representation of this task.
virtual const DtStringentityToFollow () const
 Object name of the entity to follow.
virtual void setEntityToFollow (const DtString &entity)
virtual const DtVectoroffsetVector () const
 Set/get the offset of the entity from the entity it is following.
virtual void setOffsetVector (const DtVector &offsets)
virtual int netRepSize () const
 Returns the size of the full network representation padded to an 8-byte boundary.
virtual bool setFromNet (const char *contentBuffer, unsigned contentSize)
 Fills in the task from the network buffer.
virtual bool setToNet ()
 Fills in the network buffer (created by base class simTask) with the task contents.

Static Public Member Functions

static DtSimTaskcreator ()

Protected Attributes

DtRwString myEntityToFollow
DtRwVector myOffsetVector

Detailed Description

DtFollowEntityTask represents a follow entity task for an entity to perform.

It inherits read/writableness from SimTask, and includes the entity to follow, and the offset from the entity. This offset is expressed in body coordinates (x out the front, y to the right, z down). z is ignored for ground vehicles. Therefore, to have a ground vehicle follow another entity 20m behind and 5m to the right, the offset vector would be (-20., 5., 0.)

If the entity to follow does not exist, the following entity stops. If at some later point during the simulation, the entity-to-follow comes into existence, then the entity starts following it. If the entity being followed gets destroyed, the following entity stops and sends a taskComplete(), indicating that it is finished executing the task and is ready for a new task.

An entity executing a DtFollowEntityTask will not advance to another task unless one of the following things happens:

task-type: DtFollowEntityType

parameters: entity to follow - Echelon ID string (object name) of the entity to be followed.

offset vector - Following offset expressed in body coordinates, rela- tive to the entity to be followed. In body coordinates, the X-axis points out the front of the entity, the Y-axis points to the right, and Z- axis points down. Units are in meters. For example, if the entity was tasked to follow 25 m behind the entity, and 5 m to the right, then the offset vector would be <-25.0, 5.0, 0.0>.


Constructor & Destructor Documentation

default constructor

DtFollowEntityTask::DtFollowEntityTask ( const DtString writeName,
DtReaderWriterRegistry parentRegistry = 0 
)

constructor If you have a task 'put' itself, the writeName will preface the task.

DtFollowEntityTask::DtFollowEntityTask ( const DtString writeName,
const DtFollowEntityTask orig,
DtReaderWriterRegistry parentRegistry = 0 
)

Copy constructor; nothing to be copied.

Here to thwart over-ambitious compilers that create one when it shouldn't.


Member Function Documentation

const DtFollowEntityTask& DtFollowEntityTask::operator= ( const DtFollowEntityTask orig)

assignment operator

virtual int DtFollowEntityTask::type ( ) const [virtual]

Returns DtFollowEntityType.

Implements DtSimTask.

virtual DtSimTask* DtFollowEntityTask::clone ( const DtString name,
DtReaderWriterRegistry parentRegistry = 0 
) const [virtual]

Creates a copy of this follow entity task.

Implements DtSimTask.

virtual DtString DtFollowEntityTask::stringRep ( ) const [virtual]

Get a readable string representation of this task.

Implements DtSimTask.

virtual const DtString& DtFollowEntityTask::entityToFollow ( ) const [virtual]

Object name of the entity to follow.

virtual void DtFollowEntityTask::setEntityToFollow ( const DtString entity) [virtual]
virtual const DtVector& DtFollowEntityTask::offsetVector ( ) const [virtual]

Set/get the offset of the entity from the entity it is following.

virtual void DtFollowEntityTask::setOffsetVector ( const DtVector offsets) [virtual]
virtual int DtFollowEntityTask::netRepSize ( ) const [virtual]

Returns the size of the full network representation padded to an 8-byte boundary.

Reimplemented from DtSimTask.

virtual bool DtFollowEntityTask::setFromNet ( const char *  contentBuffer,
unsigned  contentSize 
) [virtual]

Fills in the task from the network buffer.

Reimplemented from DtSimTask.

virtual bool DtFollowEntityTask::setToNet ( ) [virtual]

Fills in the network buffer (created by base class simTask) with the task contents.

Reimplemented from DtSimTask.

static DtSimTask* DtFollowEntityTask::creator ( ) [static]

Member Data Documentation


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)