![]() |
VR-Forces 4.0.4 Class Documentation
|
DtIndirectFireActuator is an actuator that provides a simple model of a cannon. More...

Public Member Functions | |
| DtIndirectFireActuator (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0) | |
| (const DtString&,DtVrfObject*,DtSimManager*, | |
| virtual | ~DtIndirectFireActuator () |
| destructor | |
| virtual void | tick () |
| Override to call initPendingDetonations() in the first tick, to schedule any outstanding detonations saved in our process state. | |
| virtual void | initPendingDetonations () |
| Called in the first tick. | |
| virtual DtString | type () const |
| Returns a string identifies the class type of component. | |
| virtual DtFireInteraction * | createFireInteraction () |
| Overrides the DtWeaponActuator to create a DtFireInteraction based on the values from the input ports. | |
| virtual DtDetonationInteraction * | createDetonationInteraction (DtTime &detTime) |
| Instantiates a DtDetonationInteraction and fills out its values based on the values from the input ports. | |
| virtual void | scheduleDetonation (DtDetonationInteraction *detInter, DtTime detTime) |
| Creates a DtDetonationTimerData object from detInter which is put into a DtTimer which generates a one-time callback to detonationCallback after detTime seconds. | |
| virtual void | fireTheWeapon () |
| DtWeaponActuator::fireTheWeapon is overridden to schedule a detonation interaction in addition to creating a fire interaction like the base class does. | |
| virtual void | addDispersion (DtVector &detLocation, bool addHeightDispersion) |
| Adjusts detLocation based on the range and displacement error probabilities in myIndirectFireActuatorDescriptor. | |
| virtual DtDetonationInteraction * | createDetonationInteraction (const DtDetonationDescriptor &desc, DtTime &detTime) |
| Creates a new DtDetonationInteraction, given a DtDetonationDescriptor. | |
| virtual DtDetonationDescriptor * | createDetonationDescriptor (DtDetonationInteraction *detInter, DtTime simTime) |
| Creates and fills out a new DtDetonationDescriptor, given a DtDetonationInteraction and a time (simulation time to fire, in seconds). | |
| virtual void | processObjectAdded (DtVrfObject *vrfObject) |
| Checks pending detonation list (in the process state repository) for target with same name as new object. | |
Static Public Member Functions | |
| static void | detonationCallback (DtTimer *timer) |
| Extracts and sends the DtDetonationInteraction stored in the DtTimer. | |
| static DtSimComponent * | creator (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0) |
| (const DtString&,DtVrfObject*,DtSimManager*, | |
| static void | objectAddedCb (DtVrfObject *vrfObject, void *usr) |
| Calls processObjectAdded(). | |
Protected Member Functions | |
| virtual bool | createPorts () |
| Creates the input ports and adds them to the component. | |
| virtual bool | createPSR () |
| Creates #myProcessState data member, and adds it to our process state repository manager. | |
| DtIndirectFireActuator () | |
| default constructor; not implemented | |
| DtIndirectFireActuator (const DtIndirectFireActuator &orig) | |
| copy constructor; not implemented | |
| const DtIndirectFireActuator & | operator= (const DtIndirectFireActuator &orig) |
| assignment operator; not implemented | |
Protected Attributes | |
| DtReal | myMuzzleSpeed |
| DtList | myTimerList |
| DtIndirectFireActuatorDescriptor * | myIndirectFireActuatorDescriptor |
| DtVrfIndirectFirePSR * | myIndirectFireProcessState |
| We've overrode createPSR() to create derived kind of DtVrfWeaponPSR. | |
| bool | myFirstTick |
Ports and Port Groups | |
| DtVectorInputPort * | myTargetPointPort |
| Input Port Name: target-point-port Input Port Description: Local position to fire at. | |
| DtAnalogInputPort * | myMaxRangePort |
| Input Port Name: max-range-port Input Port Description: Maximum range in meters. | |
DtIndirectFireActuator is an actuator that provides a simple model of a cannon.
End User Description: It can be given ammo to load, and the command to fire. It creates a fire interaction and creates a detonation interaction, which it schedules to be sent.
The accuracy of indirect fire is measured by a set of probably error distances. Fifty percent of all rounds will fall within this range (25% over, 25% under, 25% left, 25% right). All rounds will fall within four times the probably error distance.
Uses Descriptor Type: DtIndirectFireActuatorDescriptor
| DtIndirectFireActuator::DtIndirectFireActuator | ( | 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 DtIndirectFireActuator::~DtIndirectFireActuator | ( | ) | [virtual] |
destructor
| DtIndirectFireActuator::DtIndirectFireActuator | ( | ) | [protected] |
default constructor; not implemented
| DtIndirectFireActuator::DtIndirectFireActuator | ( | const DtIndirectFireActuator & | orig | ) | [protected] |
copy constructor; not implemented
| virtual void DtIndirectFireActuator::tick | ( | ) | [virtual] |
Override to call initPendingDetonations() in the first tick, to schedule any outstanding detonations saved in our process state.
Reimplemented from DtWeaponActuator.
| virtual void DtIndirectFireActuator::initPendingDetonations | ( | ) | [virtual] |
Called in the first tick.
Creates and schedules any pending detonations from detonation descriptor data in the process state repository. For those detonations whose target does not exist yet (e.g. target may be remote and not discovered yet), registers the objectAddedCb to provide an opportunity to create and schedule those pending detonations at a later time.
| virtual DtString DtIndirectFireActuator::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 DtFireInteraction* DtIndirectFireActuator::createFireInteraction | ( | ) | [virtual] |
Overrides the DtWeaponActuator to create a DtFireInteraction based on the values from the input ports.
The myMuzzleSpeed member variable is calculated as the square root of the product of the maximum range times DtGRAVITY_CONSTANT. The myCurrentRange member variable is calculated as the distance from the weapon to the target in meters. A new event Id is obtained from the exercise connection and assigned to the myCurrentEventId member variable.
Reimplemented from DtWeaponActuator.
| virtual DtDetonationInteraction* DtIndirectFireActuator::createDetonationInteraction | ( | DtTime & | detTime | ) | [virtual] |
Instantiates a DtDetonationInteraction and fills out its values based on the values from the input ports.
It will modify the given DtReal parameter to contain the amount of time in seconds before the detonation should be sent out. The delay is calculated as range / (muzzle speed * launch angle). Calls addDispersion() to introduce random error into the location of the detonation. If the fuze type is not DtFuzeContact, addDispersion() will be called with height dispersion enabled.
| virtual void DtIndirectFireActuator::scheduleDetonation | ( | DtDetonationInteraction * | detInter, |
| DtTime | detTime | ||
| ) | [virtual] |
Creates a DtDetonationTimerData object from detInter which is put into a DtTimer which generates a one-time callback to detonationCallback after detTime seconds.
| virtual void DtIndirectFireActuator::fireTheWeapon | ( | ) | [virtual] |
DtWeaponActuator::fireTheWeapon is overridden to schedule a detonation interaction in addition to creating a fire interaction like the base class does.
Reimplemented from DtWeaponActuator.
| virtual void DtIndirectFireActuator::addDispersion | ( | DtVector & | detLocation, |
| bool | addHeightDispersion | ||
| ) | [virtual] |
Adjusts detLocation based on the range and displacement error probabilities in myIndirectFireActuatorDescriptor.
If addHeightDispersion is true, then it will also adjust the height of the detonation based on the burst height probability.
| static void DtIndirectFireActuator::detonationCallback | ( | DtTimer * | timer | ) | [static] |
Extracts and sends the DtDetonationInteraction stored in the DtTimer.
| static DtSimComponent* DtIndirectFireActuator::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 DtDetonationInteraction* DtIndirectFireActuator::createDetonationInteraction | ( | const DtDetonationDescriptor & | desc, |
| DtTime & | detTime | ||
| ) | [virtual] |
Creates a new DtDetonationInteraction, given a DtDetonationDescriptor.
Fills out new new interaction with data from the descriptor and returns the detonation time (time in seconds relative to current sim time). The resulting DtDetonationInteraction and DtTime can be directly passed into scheduleDetonation.
| virtual DtDetonationDescriptor* DtIndirectFireActuator::createDetonationDescriptor | ( | DtDetonationInteraction * | detInter, |
| DtTime | simTime | ||
| ) | [virtual] |
Creates and fills out a new DtDetonationDescriptor, given a DtDetonationInteraction and a time (simulation time to fire, in seconds).
| static void DtIndirectFireActuator::objectAddedCb | ( | DtVrfObject * | vrfObject, |
| void * | usr | ||
| ) | [static] |
Calls processObjectAdded().
| virtual void DtIndirectFireActuator::processObjectAdded | ( | DtVrfObject * | vrfObject | ) | [virtual] |
Checks pending detonation list (in the process state repository) for target with same name as new object.
If one exists, sets the target global id in the pending object item (a DtDetonationDescriptor), and then schedules the detonation, given the data in the descriptor.
| virtual bool DtIndirectFireActuator::createPorts | ( | ) | [protected, virtual] |
Creates the input ports and adds them to the component.
Reimplemented from DtWeaponActuator.
| virtual bool DtIndirectFireActuator::createPSR | ( | ) | [protected, virtual] |
Creates #myProcessState data member, and adds it to our process state repository manager.
Passes in the name and type specified in the component descriptor (if they exist) to the DtVrfProcessStateRepository::createRepository factory method. If name and/or type is not specified, uses the appropriate default strings defined in procSRTypes.h.
Reimplemented from DtWeaponActuator.
| const DtIndirectFireActuator& DtIndirectFireActuator::operator= | ( | const DtIndirectFireActuator & | orig | ) | [protected] |
assignment operator; not implemented
Input Port Name: target-point-port
Input Port Description: Local position to fire at.
Input Port Range:
Input Port Default Value:
Input Group Parent:
DtAnalogInputPort* DtIndirectFireActuator::myMaxRangePort [protected] |
Input Port Name: max-range-port
Input Port Description: Maximum range in meters.
Input Port Range:
Input Port Default Value:
Input Group Parent:
DtReal DtIndirectFireActuator::myMuzzleSpeed [protected] |
DtList DtIndirectFireActuator::myTimerList [protected] |
DtIndirectFireActuatorDescriptor* DtIndirectFireActuator::myIndirectFireActuatorDescriptor [protected] |
We've overrode createPSR() to create derived kind of DtVrfWeaponPSR.
This member variable provided for convenient point to derived type.
bool DtIndirectFireActuator::myFirstTick [protected] |