![]() |
VR-Forces 4.0.4 Class Documentation
|
DtLauncherActuator is a simple model of a missile launcher. More...

Public Member Functions | |
| DtLauncherActuator (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0) | |
| (const DtString&,DtVrfObject*,DtSimManager*, | |
| virtual | ~DtLauncherActuator () |
| destructor | |
| virtual bool | init () |
| to get access to the entity's localStateRepository, which this component will update, and then connect to the controller's ports. | |
| virtual DtString | type () const |
| Returns a string identifies the class type of component. | |
| virtual void | fireTheWeapon () |
| Overrides DtWeaponActuator::fireTheWeapon(). | |
| virtual DtFireInteraction * | createFireInteraction (DtVrfObject *missile) |
| Creates and fills out a DtFireInteraction, given a missile object. | |
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 () |
| Creates the input ports listed in the header comment and adds them to myWeaponInputPortGroup from DtWeaponActuator. | |
| DtLauncherActuator () | |
| default constructor; not implemented | |
| DtLauncherActuator (const DtLauncherActuator &orig) | |
| copy constructor; not implemented | |
| const DtLauncherActuator & | operator= (const DtLauncherActuator &orig) |
| assignment operator; not implemented | |
Protected Attributes | |
| DtVector | myCurrentTargetPoint |
Ports and Port Groups | |
| DtObjectIdInputPort * | myMissileIdPort |
| Input Port Name: missile-id Input Port Description: Object id of the missile. | |
| DtObjectIdInputPort * | myTargetEntityIdPort |
| Input Port Name: target-entity Input Port Description: Object id of the target. | |
| DtVectorInputPort * | myTargetPointPort |
| Input Port Name: target-point Input Port Description: Local position of the target. | |
Static Protected Attributes | |
| static bool | myDetonationCbackRegistered |
| Flag for indicating whether the detonation callback for munitions has been registered. | |
DtLauncherActuator is a simple model of a missile launcher.
End User Description: It can be given ammo to load, and the command to fire. It creates a fire interaction and creates a missile object, and sends it on its way.
It can be configured on an entity on its own, forming a fixed launcher, or it can be used in conjunction with the DtAzimuthMountActuator, the DtElevationMountActuator, or both, to form a missile launcher system that can be aimed.
The DtLauncherActuator class is derived from DtWeaponActuator and adds missile ID and target point ports to the ammunition, trigger, and loaded (a boolean flag indicating the weapon is loaded) inputs provided by the DtWeaponActuator.
Uses Descriptor Type: DtWeaponActuatorDescriptor
| DtLauncherActuator::DtLauncherActuator | ( | 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 DtLauncherActuator::~DtLauncherActuator | ( | ) | [virtual] |
destructor
| DtLauncherActuator::DtLauncherActuator | ( | ) | [protected] |
default constructor; not implemented
| DtLauncherActuator::DtLauncherActuator | ( | const DtLauncherActuator & | orig | ) | [protected] |
copy constructor; not implemented
| virtual bool DtLauncherActuator::init | ( | ) | [virtual] |
to get access to the entity's localStateRepository, which this component will update, and then connect to the controller's ports.
Reimplemented from DtWeaponActuator.
| virtual DtString DtLauncherActuator::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.
Reimplemented from DtWeaponActuator.
| virtual void DtLauncherActuator::fireTheWeapon | ( | ) | [virtual] |
Overrides DtWeaponActuator::fireTheWeapon().
It takes the missile ID found on myMissileIdPort and uses it to look up the corresponding missile object in the DtVrfObjectManager. If a missile object is found, it initializes the missile's start location, orientation, and velocity. If the target-entity port has a target it is passed to the missile's state repository, otherwise it passes the location on the target-point port. It then calls createFireInteraction() with the missile object as an argument.
Reimplemented from DtWeaponActuator.
| virtual DtFireInteraction* DtLauncherActuator::createFireInteraction | ( | DtVrfObject * | missile | ) | [virtual] |
Creates and fills out a DtFireInteraction, given a missile object.
| static DtSimComponent* DtLauncherActuator::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). |
Reimplemented from DtWeaponActuator.
| virtual bool DtLauncherActuator::createPorts | ( | ) | [protected, virtual] |
Creates the input ports listed in the header comment and adds them to myWeaponInputPortGroup from DtWeaponActuator.
Reimplemented from DtWeaponActuator.
| const DtLauncherActuator& DtLauncherActuator::operator= | ( | const DtLauncherActuator & | orig | ) | [protected] |
assignment operator; not implemented
DtObjectIdInputPort* DtLauncherActuator::myMissileIdPort [protected] |
Input Port Name: missile-id
Input Port Description: Object id of the missile.
Input Port Range:
Input Port Default Value:
Input Group Parent: weapon-control
Input Port Name: target-entity
Input Port Description: Object id of the target.
Input Port Range:
Input Port Default Value:
Input Group Parent: weapon-control
DtVectorInputPort* DtLauncherActuator::myTargetPointPort [protected] |
Input Port Name: target-point
Input Port Description: Local position of the target.
Input Port Range:
Input Port Default Value:
Input Group Parent: weapon-control
bool DtLauncherActuator::myDetonationCbackRegistered [static, protected] |
Flag for indicating whether the detonation callback for munitions has been registered.
DtVector DtLauncherActuator::myCurrentTargetPoint [protected] |