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

The DtTurretAcquireController attempts to slew the turret to track targets. More...

Inheritance diagram for DtTurretAcquireController:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 DtTurretAcquireController (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 (const DtString&,DtVrfObject*,DtSimManager*,
virtual ~DtTurretAcquireController ()
 destructor
virtual DtString type () const
 Returns a string identifies the class type of component.
virtual bool init ()
 Sets myObjectId.
virtual void tick ()
 Calculate new control values.
virtual bool inSector (DtVrfObject *entity) const
 Calls DtVrfObjectStateRepository::inSOR.
virtual DtReal findBodyHeadingToTarget (DtVrfObject *entity) const
 Returns heading to target in body coordinates.
virtual DtVrfObjectchooseTarget (const DtEntityTargetList &targetList, DtTime currentTime) const
 Choses target based on sector of responsibility & easier()
virtual DtVrfObjecteasier (DtVrfObject *entity1, DtVrfObject *entity2) const
 Returns entity1.

Static Public Member Functions

static DtSimComponentcreator (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 (const DtString&,DtVrfObject*,DtSimManager*,

Protected Member Functions

virtual bool createPorts ()
 Called by init to create the targetListInputPort.
virtual bool canTrackTarget (const DtVector &localEyepoint, DtVrfObject *targetObject) const

Protected Attributes

const
DtTurretAcquireControllerDescriptor
myTurretAcquireControllerDescriptor
DtEntityIdentifier myObjectId
 cached in init() to avoid repeated lookups
Ports and Port Groups
DtEntityListInputPortmyTargetListPort
 Input Port Name: target-list
Input Port Description: List of detected hostile targets.

Private Member Functions

 DtTurretAcquireController ()
 default constructor; not implemented
 DtTurretAcquireController (const DtTurretAcquireController &orig)
 copy constructor; not implemented
const DtTurretAcquireControlleroperator= (const DtTurretAcquireController &orig)
 assignment operator; not implemented

Detailed Description

The DtTurretAcquireController attempts to slew the turret to track targets.

End User Description: The controller first checks to see if there is a current target for the entity. If there is, it slews the turret as necessary to track the target. If not, it checks the target port from the detection sensor. If there are targets on the port, the controller chooses one based on in-sector vs. out-of-sector and closest angular distance to the current turret position.

The DtTurretAcquireController can also process "Fire-Now" messages. It slews the turret to face the target specified in the fire now message. Once the target is lined up (ignoring range, and line of sight) the rules of engagement are set to fire-at-will, and the target-acquired flag is set to true so that the main gun will fire once it has loaded. This component then listens for a fire interaction originating from this entity, at which time this controller releases control of the ports. A timeout is also set through the descriptor so that this component will release control at a predetermined period after the fire-now command is received. This ensures that the entity will not get stuck in a "fire-now" mode even if it has run out of ammunition or does not have a munition type to use against the specified target.

Uses Descriptor Type: DtTurretAcquireControllerDescriptor


Constructor & Destructor Documentation

DtTurretAcquireController::DtTurretAcquireController ( 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; not implemented

copy constructor; not implemented


Member Function Documentation

virtual DtString DtTurretAcquireController::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:
DtTurretAcquireControllerType

Implements DtTurretSlewController.

virtual bool DtTurretAcquireController::init ( ) [virtual]

Sets myObjectId.

Reimplemented from DtTurretSlewController.

virtual void DtTurretAcquireController::tick ( ) [virtual]

Calculate new control values.

Reimplemented from DtTurretSlewController.

virtual bool DtTurretAcquireController::inSector ( DtVrfObject entity) const [virtual]
virtual DtReal DtTurretAcquireController::findBodyHeadingToTarget ( DtVrfObject entity) const [virtual]

Returns heading to target in body coordinates.

virtual DtVrfObject* DtTurretAcquireController::chooseTarget ( const DtEntityTargetList &  targetList,
DtTime  currentTime 
) const [virtual]

Choses target based on sector of responsibility & easier()

virtual DtVrfObject* DtTurretAcquireController::easier ( DtVrfObject entity1,
DtVrfObject entity2 
) const [virtual]

Returns entity1.

static DtSimComponent* DtTurretAcquireController::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.
virtual bool DtTurretAcquireController::createPorts ( ) [protected, virtual]

Called by init to create the targetListInputPort.

Reimplemented from DtTurretSlewController.

virtual bool DtTurretAcquireController::canTrackTarget ( const DtVector localEyepoint,
DtVrfObject targetObject 
) const [protected, virtual]
Returns:
true if the specified target can be tracked by this entity. A target can be tracked if: The check-LOS flag is false. OR The track-by-signature is TRUE and the apparent signature of the target >= min-track-signature. OR The track-by-signature is FALSE and physicalWorld()->checkLineOfSight() returns true.
const DtTurretAcquireController& DtTurretAcquireController::operator= ( const DtTurretAcquireController orig) [private]

assignment operator; not implemented


Member Data Documentation

Input Port Name: target-list
Input Port Description: List of detected hostile targets.


Input Port Range:
Input Port Default Value:
Input Group Parent:

DtEntityIdentifier DtTurretAcquireController::myObjectId [protected]

cached in init() to avoid repeated lookups


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)