![]() |
VR-Forces 4.10 Class Documentation
|
The DtDetonationManager class exists to centralize the processing of detonation interactions. More...
Classes | |
| struct | DtCollateralDetonationTargetInfo |
| struct | DtDetonationCallbackInfo |
| struct | DtDirectDetonationTargetInfo |
Public Types | |
| typedef bool(* | DtDamageAdjudicationFunction )(const DtDetonationContext &detonationContext, void *usr) |
| typedef std::map < DtSimMunition, double > | DtMunitionDamageMap |
| typedef std::map< DtString, double > | DtPowerDamageMap |
| typedef std::list < DtDetonationCallbackInfo > | DtDetonationCallbackInfoList |
| typedef DtBoost::shared_ptr < DtDirectDetonationTargetInfo > | DtDirectDetonationTargetInfoPtr |
| typedef std::list < DtDirectDetonationTargetInfoPtr > | DtDirectDetonationTargetList |
| typedef std::map< DtUUID, DtDirectDetonationTargetInfoPtr > | DtDirectDetonationTargetMap |
| typedef DtBoost::shared_ptr < DtCollateralDetonationTargetInfo > | DtCollateralDetonationTargetInfoPtr |
| typedef std::list < DtCollateralDetonationTargetInfoPtr > | DtCollateralDetonationTargetList |
| typedef std::map< DtUUID, DtCollateralDetonationTargetInfoPtr > | DtCollateralDetonationTargetMap |
Public Member Functions | |
| DtDetonationManager (DtSimManager &simManager) | |
| Constructs the detonation manager. More... | |
| virtual | ~DtDetonationManager () |
| The destructor. More... | |
| virtual bool | init () |
| Initializes the detonation manager. More... | |
| virtual bool | reinitialize () |
| Resets the detonation manager to initial state. More... | |
| virtual bool | registerDirectDetonation (const DtVrfObject &entity, DtGlobalObjectDesignator entityId, void *callbackObject, DtDamageAdjudicationFunction func) |
| Entities that wish to receive detonation notifications (technically, it is usually the actuators which register for the entity) call these functions. More... | |
| virtual bool | registerCollateralDetonation (const DtVrfObject &entity, DtGlobalObjectDesignator entityId, DtSimMunition munition, double maxDamageRadius, void *callbackObject, DtDamageAdjudicationFunction func) |
| Use this function to register interest in collateral detonations ie ground detonations from indirect fire, missile detonations or direct fire detonations that would cause collateral damage to nearby entities. More... | |
| virtual bool | registerCollateralDetonationByPower (const DtVrfObject &entity, DtGlobalObjectDesignator entityId, const DtString &powerType, double minDamagePower, void *callbackObject, DtDamageAdjudicationFunction func) |
| Use this function to register interest in collateral detonations ie ground detonations from indirect fire, missile detonations or direct fire detonations that would cause collateral damage to nearby entities. More... | |
| virtual bool | unRegisterDirectDetonationTarget (const DtVrfObject &entity) |
| Removes the entity from the detonation manager's container of detonation targets. More... | |
| virtual bool | unRegisterCollateralDetonationTarget (const DtVrfObject &entity) |
| virtual bool | unRegisterCollateralDetonationCallback (const DtVrfObject &entity, void *callbackObject, DtDamageAdjudicationFunction func) |
| Removes the given entity callback from the detonation manager's container of detonation target callbacks. More... | |
| virtual bool | isTargetInterestedInCollateralDetonation (const DtDetonationCallbackInfo &target, double impactRange, double shooterRange, DtDetonationContext &detonationContext) const |
| Returns true if the target has registered interest in the given detonation at the given range. More... | |
| virtual double | lookupMunitionInCollateralDetonationMap (const DtDetonationCallbackInfo &target, const DtSimMunition &munition) const |
| If the munition is found returns the maximum damage radius of the munition. More... | |
| virtual void | sendDetonationInteraction (DtDetonationInteraction &detonation) |
| Send the fully initialized detonation interaction. More... | |
| virtual bool | loadParametersFromFile (const DtFilename &filename) |
| Calls createParameters() to get a new instance of the parameter object, and calls getSelf() on the parameters to load them from the file. More... | |
| virtual bool | loadDeformationParametersFromFile (const DtFilename &filename) |
| virtual double | detonationPower (const DtSimMunition &munition, double rangeFromShooter, double rangeFromImpact, const DtString &powerType) const |
| Returns the detonation power for the specified munition, range from shooter, range from impact, and power type. More... | |
| virtual DtTerrainDeformationParams * | terrainDeformationParameters () |
| virtual const DtTerrainDeformationParams * | terrainDeformationParameters () const |
| virtual void | resetParameters () |
| Resets the parameters. More... | |
| virtual bool | parametersLoaded () const |
| virtual const DtFilename & | parametersFile () const |
| virtual const DtFilename & | deformationParametersFile () const |
| virtual DtDetonationResult | detonationResult (const DtSimMunition &munition, const DtEntityType &targetEntityType, const DtVector &localPosition) const |
| Determines the detonation result based on the munition and other factors. More... | |
| virtual DtDetonationResult | detonationResult (const DtSimMunition &munition, const DtSurface &terrainSurface, const DtVector &localPosition) const |
| Returns the detonation result when a munition of the given type hits the terrain with the given surface type. More... | |
| virtual DtDetonationResult | detonationResultMidAir (const DtSimMunition &munition, const DtVector &localPosition) const |
| Returns the detonation result for a munition of the given type that when it detonates in mid-air. More... | |
| virtual DtDetonationParams * | parameters () |
| virtual const DtDetonationParams * | parameters () const |
Protected Member Functions | |
| virtual void | processUUIDChange (const DtVrfObjectUUIDChangedCallbackInfo &change) |
| virtual void | processDetonation (const DtDetonationInteraction &detonation) |
| Process the detonation interaction by properly creating a detonation context for the interaction, and then notifying all the appropriate entities of the detonation. More... | |
| virtual const DtPhysicalWorld * | physicalWorld () const |
| virtual DtPhysicalWorld * | physicalWorld () |
| virtual Coordinate_System * | coordinateSystem () |
| virtual const Coordinate_System * | coordinateSystem () const |
| virtual void | processCollateralDetonationForEntitiesInRange (DtDetonationContext &detonationContext) |
| Checks all entities who've registered interest in the munition in detonation context Checks the range of the detonation to the entity against the entity's maximumDamageRadius for that munition. More... | |
| virtual DtDetonationResult | defaultDetonationResult () const |
| Returns the default detonation result. Default implementation returns DtDetResDetonation. More... | |
| void | cleanOutDeadEntities () |
| virtual DtDetonationParams * | createParameters () |
| virtual DtTerrainDeformationParams * | createDeformationParameters () |
| virtual void | detonationEvent (const DtEvent &) |
| Called for detonation event. More... | |
Static Protected Member Functions | |
| static void | uuidChangeCallback (const DtVrfObjectUUIDChangedCallbackInfo &change, void *usr) |
Protected Attributes | |
| DtDirectDetonationTargetMap | myDirectDetonationTargetMap |
| DtCollateralDetonationTargetMap | myCollateralDetonationTargetMap |
| bool | myQueueEntitiesToBeRemoved |
| After all the callbacks have been made those who've been destroyed or asked to unregistered need to be removed from the collateral target map. More... | |
| std::list< DtUUID > | myEntitiesQueuedToBeRemovedList |
| DtSimManager & | mySimManager |
| DtFilename | myParametersFile |
| DtFilename | myDeformationParamsFile |
| DtDetonationParams * | myParameters |
| Parameters for this detonation manager. More... | |
| DtTerrainDeformationParams * | myDeformationParams |
| tbb::recursive_mutex | myMutex |
Private Member Functions | |
| DtDetonationManager (const DtDetonationManager &orig) | |
| Not defined! copy constructor. More... | |
| DtDetonationManager & | operator= (const DtDetonationManager &other) |
| assignment operator More... | |
The DtDetonationManager class exists to centralize the processing of detonation interactions.
Components register with the detonation manager, providing a pointer to a DtVrfObject as well as the objects global designator, and a damage adjudication function to call when the detonation 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.
With regards to detonation interactions, for a result of "entity proximate", where the entity is specified as the target, or for a result of simply "detonation", the range to the detonation is determined, and the damage probability is determined using a surface of "front" and an angle of incidence of 0. The detonation manager fills in a detonation context with all the appropriate information, and looks up the entity to see if it has registered a callback. If so, it calls the registered callback, supplying the detonation context.
When a detonation manager receives a detonation of type DtDetResDetonation (sent by the indirect fire actuator for artillery), it again fills in the detonation context, but then calls all appropriate entities with registered callbacks.
| typedef bool(* DtDetonationManager::DtDamageAdjudicationFunction)(const DtDetonationContext &detonationContext, void *usr) |
| typedef std::map<DtSimMunition, double> DtDetonationManager::DtMunitionDamageMap |
| typedef std::map<DtString, double> DtDetonationManager::DtPowerDamageMap |
| typedef std::list<DtDetonationCallbackInfo> DtDetonationManager::DtDetonationCallbackInfoList |
| typedef DtBoost::shared_ptr<DtDirectDetonationTargetInfo> DtDetonationManager::DtDirectDetonationTargetInfoPtr |
| typedef std::list<DtDirectDetonationTargetInfoPtr> DtDetonationManager::DtDirectDetonationTargetList |
| typedef std::map<DtUUID, DtDirectDetonationTargetInfoPtr> DtDetonationManager::DtDirectDetonationTargetMap |
| typedef DtBoost::shared_ptr<DtCollateralDetonationTargetInfo> DtDetonationManager::DtCollateralDetonationTargetInfoPtr |
| typedef std::list<DtCollateralDetonationTargetInfoPtr> DtDetonationManager::DtCollateralDetonationTargetList |
| typedef std::map<DtUUID, DtCollateralDetonationTargetInfoPtr> DtDetonationManager::DtCollateralDetonationTargetMap |
| DtDetonationManager::DtDetonationManager | ( | DtSimManager & | simManager | ) |
Constructs the detonation manager.
| simManager | A pointer to the simulation manager for the simulation. |
|
virtual |
The destructor.
Removes the DtDetonationInteraction::removeCallback from the exercise connection.
|
private |
Not defined! copy constructor.
|
virtual |
Initializes the detonation manager.
|
virtual |
Resets the detonation manager to initial state.
|
virtual |
Entities that wish to receive detonation notifications (technically, it is usually the actuators which register for the entity) call these functions.
Use this function to register interest in direct detonations ie entity impact or
entity proximate detonations. Supplies the entity, the entity ID, a callback function and a pointer to the actuator (void *)
|
virtual |
Use this function to register interest in collateral detonations ie ground detonations from indirect fire, missile detonations or direct fire detonations that would cause collateral damage to nearby entities.
Supplies the entity, the entity ID, the munition being used, it's maximum radius that it can cause damage to the entity, a callback function, and a pointer to the actuator (void *). The munition and maximum damage radius are stored in the collateralDetonationTargetInfoPtr's damageMap keyed by munition.
|
virtual |
Use this function to register interest in collateral detonations ie ground detonations from indirect fire, missile detonations or direct fire detonations that would cause collateral damage to nearby entities.
Supplies the entity, the entity ID, the type of detonation power (e.g. "explosive"), the minimum power that can cause damage to the entity, a callback function, and a pointer to the actuator (void *).
|
virtual |
Removes the entity from the detonation manager's container of detonation targets.
| entity | the address of the entity to be unregistered. |
|
virtual |
|
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 detonation at the given range.
If true, fills in the detonation context with the range and power information.
|
virtual |
If the munition is found returns the maximum damage radius of the munition.
|
virtual |
Send the fully initialized detonation interaction.
|
virtual |
Calls createParameters() to get a new instance of the parameter object, and calls getSelf() on the parameters to load them from the file.
Assigns the newly loaded parameters to myParameters and processes parameters specified.
|
virtual |
|
virtual |
Returns the detonation power for the specified munition, range from shooter, range from impact, and power type.
|
virtual |
Determines the detonation result based on the munition and other factors.
Returns the detonation result when a munition of the given type hits an entity of the given type. In the default implementation, localPosition is not used, but can be in custom implementations.
|
virtual |
Returns the detonation result when a munition of the given type hits the terrain with the given surface type.
If the surface type is null, then the default detonation result is used. In the default implementation, localPosition is not used, but can be in custom implementations.
|
virtual |
Returns the detonation result for a munition of the given type that when it detonates in mid-air.
In the default implementation, localPosition is not used, but can be in custom implementations.
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
Resets the parameters.
|
virtual |
|
virtual |
|
virtual |
|
staticprotected |
|
protectedvirtual |
|
protectedvirtual |
Process the detonation interaction by properly creating a detonation context for the interaction, and then notifying all the appropriate entities of the detonation.
For entity impact and proximate detonations, only the specified entity is notified. For detonation 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 |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
Checks all entities who've registered interest in the munition in detonation context Checks the range of the detonation to the entity against the entity's maximumDamageRadius for that munition.
If the detonation is within that range then tell that entity to process this detonation and determine any collateral damage from it.
|
protectedvirtual |
Returns the default detonation result. Default implementation returns DtDetResDetonation.
|
protected |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
Called for detonation event.
|
private |
assignment operator
|
protected |
|
protected |
|
protected |
After all the callbacks have been made those who've been destroyed or asked to unregistered need to be removed from the collateral target map.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Parameters for this detonation manager.
|
protected |
|
protected |