![]() |
VR-Forces 4.0.4 Class Documentation
|
The DtTurretAcquireController attempts to slew the turret to track targets. More...

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 DtVrfObject * | chooseTarget (const DtEntityTargetList &targetList, DtTime currentTime) const |
| Choses target based on sector of responsibility & easier() | |
| virtual DtVrfObject * | easier (DtVrfObject *entity1, DtVrfObject *entity2) const |
| Returns entity1. | |
Static Public Member Functions | |
| static DtSimComponent * | creator (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 | |
| DtEntityListInputPort * | myTargetListPort |
| 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 DtTurretAcquireController & | operator= (const DtTurretAcquireController &orig) |
| assignment operator; not implemented | |
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
| DtTurretAcquireController::DtTurretAcquireController | ( | const DtString & | name, |
| DtVrfObject * | owner, | ||
| DtSimManager * | simManager, | ||
| DtComponentDescriptor * | desc = 0, |
||
| DtReaderWriterRegistry * | parentRegistry = 0 |
||
| ) |
(const DtString&,DtVrfObject*,DtSimManager*,
| name | Reader writer name of this component. |
| owner | The DtVrfObject that owns this component |
| simManager | The simulation manager (provides access to terrain, message interface, simulation clock). |
| desc | The component descriptor used to initialize this component. |
| parentRegistry | Pointer to the parent reader writer registry (the containing object that reads/writes this object). |
| virtual DtTurretAcquireController::~DtTurretAcquireController | ( | ) | [virtual] |
destructor
| DtTurretAcquireController::DtTurretAcquireController | ( | ) | [private] |
default constructor; not implemented
| DtTurretAcquireController::DtTurretAcquireController | ( | const DtTurretAcquireController & | orig | ) | [private] |
copy constructor; not implemented
| 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.
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*,
| name | Reader writer name of this component. |
| owner | The DtVrfObject that owns this component |
| simManager | The simulation manager (provides access to terrain, message interface, simulation clock). |
| desc | The component descriptor used to initialize this component. |
| parentRegistry | Pointer to the parent reader writer registry (the containing object that reads/writes this object). |
| 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] |
| const DtTurretAcquireController& DtTurretAcquireController::operator= | ( | const DtTurretAcquireController & | orig | ) | [private] |
assignment operator; not implemented
Input Port Name: target-list
Input Port Description: List of detected hostile targets.
Input Port Range:
Input Port Default Value:
Input Group Parent:
const DtTurretAcquireControllerDescriptor* DtTurretAcquireController::myTurretAcquireControllerDescriptor [protected] |
DtEntityIdentifier DtTurretAcquireController::myObjectId [protected] |
cached in init() to avoid repeated lookups