![]() |
VR-Forces 4.10 Class Documentation
|
The DtFireManager class exists to centralize the processing of fire interactions. More...
Classes | |
| struct | DtFireRangeCallbackInfo |
| struct | DtFireRangeInfo |
Public Types | |
| typedef bool(* | DtFireProcessingFunction )(const DtFireContext &fireContext, void *usr) |
| typedef std::map< const DtVrfObject *, DtGlobalObjectDesignator > | DtRegisteredVrfObjects |
| typedef std::map< const DtVrfObject *, DtFireProcessingFunction > | DtFireCallbackFuncs |
| typedef std::map< const DtVrfObject *, void * > | DtFireCallbackObjects |
| typedef std::map < DtSimMunition, double > | DtFireRangeMap |
| typedef std::list < DtFireRangeCallbackInfo > | DtFireRangeCallbackInfoList |
| typedef DtBoost::shared_ptr < DtFireRangeInfo > | DtFireRangeInfoPtr |
| typedef std::map< DtUUID, DtFireRangeInfoPtr > | DtFireRangeInfoMap |
Public Member Functions | |
| DtFireManager (DtSimManager &simManager) | |
| Constructs the fire manager. More... | |
| virtual | ~DtFireManager () |
| The destructor. More... | |
| virtual bool | init () |
| Initializes the fire manager. More... | |
| virtual bool | reinitialize () |
| Same as init, but intended to be called after the object has already been created. More... | |
| virtual bool | registerFireTarget (DtVrfObject &entity, DtGlobalObjectDesignator entityId, void *callbackObject, DtFireProcessingFunction func) |
| Entities that wish to receive fire notifications (technically, it is usually the under-fire sensors which register for the entity) call this function. More... | |
| virtual bool | registerFireTargetForRemoval (DtVrfObject &entity) |
| Registers the entity pointer for later removal from the fire targets containers. More... | |
| virtual bool | unRegisterFireTarget (DtVrfObject &entity) |
| Removes the entity from the fire manager's container of fire targets. More... | |
| virtual void | sendFireInteraction (DtFireInteraction &fire) |
| Send the fully initialized fire interaction. More... | |
| virtual bool | registerFireInArea (const DtVrfObject &entity, DtGlobalObjectDesignator entityId, DtSimMunition munition, double maxRadius, void *callbackObject, DtFireProcessingFunction func) |
| Use this function to register interest in fire in an area defined by a radius Supplies the entity, the entity ID, the munition being used, maximum radius, a callback function, and a pointer to the actuator (void *). More... | |
| virtual bool | unRegisterFireInAreaCallback (const DtVrfObject &entity, void *callbackObject, DtFireProcessingFunction func) |
| Removes the given entity callback from the detonation manager's container of detonation target callbacks. More... | |
| virtual bool | isTargetInterestedInFire (const DtFireRangeCallbackInfo &target, double range, DtFireContext &fireContext) const |
| Returns true if the target has registered interest in the given fire at the given range. More... | |
| virtual double | lookupMunitionInFireRangeMap (const DtFireRangeCallbackInfo &target, const DtSimMunition &munition) const |
| If the munition is found returns the maximum radius of the munition. More... | |
Protected Member Functions | |
| virtual void | processDetonation (const DtDetonationInteraction &fire) |
| Process the detonation interaction by properly creating a detonation context for the interaction, and then notifying all the appropriate entities. More... | |
| virtual void | processFire (const DtFireInteraction &fire) |
| Process the fire interaction by properly creating a fire context for the interaction, and then notifying all the appropriate entities. More... | |
| virtual void | processUUIDChange (const DtVrfObjectUUIDChangedCallbackInfo &change) |
| virtual void | determineUnderFire (const DtDetonationInteraction &detonation) |
| This is used for determining if the entity is under fire. More... | |
| virtual void | determineUnderFire (const DtFireInteraction &fireInter) |
| This is used for determining if the entity is under fire. More... | |
| virtual void | removeQueuedFireTargets () |
| Unregisters all fire targets that have been registered to be removed. More... | |
| virtual void | fireEvent (const DtEvent &) |
| Process events. More... | |
| virtual void | detonationEvent (const DtEvent &) |
| virtual void | processFireForEntitiesInRange (const DtFireInteraction &fireInter) |
| Checks all entities who've registered interest in the munition in fire interaction Checks the range of the fire to the entity against the entity's maximumRadius for that munition. More... | |
| DtFireManager (const DtFireManager &orig) | |
| Not defined! copy constructor. More... | |
| DtFireManager & | operator= (const DtFireManager &other) |
| assignment operator More... | |
Static Protected Member Functions | |
| static void | uuidChangeCallback (const DtVrfObjectUUIDChangedCallbackInfo &change, void *usr) |
Protected Attributes | |
| DtRegisteredVrfObjects | myFireTargets |
| A container of vrfObjects that have registered for fire interaction processing. More... | |
| DtFireCallbackFuncs | myFireCallbacks |
| The callback functions registered by the vrfObjects. More... | |
| DtFireCallbackObjects | myFireCallbackObjects |
| To ensure that the callback has all the data necessary, this callback object is registered by the vrfObject and is supplied along with the detonation context to the registered detonation callback. More... | |
| std::vector< DtVrfObject * > | myFireTargetsToBeRemoved |
| This container contains all the fire targets to be removed. More... | |
| DtSimManager & | mySimManager |
| tbb::recursive_mutex | myMutex |
| DtFireRangeInfoMap | myFireRangeInfoMap |
The DtFireManager class exists to centralize the processing of fire interactions.
Components register with the manager, providing a pointer to a DtVrfObject as well as the object's global designator, and a under-fire determination function to call when the fire affects the registered vrfobject. The detonation manager determines the entity or entities the detonation affects, and notifies them and only them through the supplied callback functions.
| typedef bool(* DtFireManager::DtFireProcessingFunction)(const DtFireContext &fireContext, void *usr) |
| typedef std::map<const DtVrfObject*, DtGlobalObjectDesignator> DtFireManager::DtRegisteredVrfObjects |
| typedef std::map<const DtVrfObject*, DtFireProcessingFunction> DtFireManager::DtFireCallbackFuncs |
| typedef std::map<const DtVrfObject*, void*> DtFireManager::DtFireCallbackObjects |
| typedef std::map<DtSimMunition, double> DtFireManager::DtFireRangeMap |
| typedef std::list<DtFireRangeCallbackInfo> DtFireManager::DtFireRangeCallbackInfoList |
| typedef DtBoost::shared_ptr<DtFireRangeInfo> DtFireManager::DtFireRangeInfoPtr |
| typedef std::map<DtUUID, DtFireRangeInfoPtr> DtFireManager::DtFireRangeInfoMap |
| DtFireManager::DtFireManager | ( | DtSimManager & | simManager | ) |
Constructs the fire manager.
| simManager | A pointer to the simulation manager for the simulation. |
|
virtual |
The destructor.
Removes the DtFireInteraction callback from the exercise connection.
|
protected |
Not defined! copy constructor.
|
virtual |
Initializes the fire manager.
|
virtual |
|
virtual |
Entities that wish to receive fire notifications (technically, it is usually the under-fire sensors which register for the entity) call this function.
By supplying the entity, the entity ID, a callback function and a pointer to the expected callback object (usually the sensor component itself, as a void*, this manager can then notify the appropriate sensor when fire interactions occur so that they can determine under-fire status.
|
virtual |
Registers the entity pointer for later removal from the fire targets containers.
All elements registered to be removed will be removed the next time it determines under fire status.
Detailed description: Because sensors are not ticked when the entity is destroyed, they will only discover they should be unregistered when callbacks are called. But removing the registered entity then is problematic, so they register to be removed later.
|
virtual |
Removes the entity from the fire manager's container of fire targets.
| entity | the address of the entity to be unregistered. |
|
virtual |
Send the fully initialized fire interaction.
|
virtual |
Use this function to register interest in fire in an area defined by a radius Supplies the entity, the entity ID, the munition being used, maximum radius, a callback function, and a pointer to the actuator (void *).
The munition and maximum radius are stored in the collateralDetonationTargetInfoPtr's damageMap keyed by munition.
|
virtual |
Removes the given entity callback from the detonation manager's container of detonation target callbacks.
|
virtual |
Returns true if the target has registered interest in the given fire at the given range.
If true, fills in the fire context with the range.
|
virtual |
If the munition is found returns the maximum radius of the munition.
|
protectedvirtual |
Process the detonation interaction by properly creating a detonation context for the interaction, and then notifying all the appropriate entities.
For entity impact and proximate fire interactions, only the specified entity is notified. For fire and ground proximate interactions, all entities within range are notified. For ground impacts, entities in range are only notified if the munition was a missile.
|
protectedvirtual |
Process the fire interaction by properly creating a fire context for the interaction, and then notifying all the appropriate entities.
For entity impact and proximate fire interactions, only the specified entity is notified. For fire and ground proximate interactions, all entities within range are notified. For ground impacts, entities in range are only notified if the munition was a missile.
|
staticprotected |
|
protectedvirtual |
|
protectedvirtual |
This is used for determining if the entity is under fire.
|
protectedvirtual |
This is used for determining if the entity is under fire.
|
protectedvirtual |
Unregisters all fire targets that have been registered to be removed.
|
protectedvirtual |
Process events.
|
protectedvirtual |
|
protectedvirtual |
Checks all entities who've registered interest in the munition in fire interaction Checks the range of the fire to the entity against the entity's maximumRadius for that munition.
If the fire is within that range then tell that entity to process this fire.
|
protected |
assignment operator
|
protected |
A container of vrfObjects that have registered for fire interaction processing.
|
protected |
The callback functions registered by the vrfObjects.
When a fire interaction occurs, the callback associated with the appropriate entity is used.
|
protected |
To ensure that the callback has all the data necessary, this callback object is registered by the vrfObject and is supplied along with the detonation context to the registered detonation callback.
|
protected |
This container contains all the fire targets to be removed.
|
protected |
|
protected |
|
protected |