12#ifndef WSFWEAPONENGAGEMENT_HPP
13#define WSFWEAPONENGAGEMENT_HPP
15#include "wsf_mil_export.h"
63 static std::unique_ptr<UtScriptClass> CreateScriptClass(
const std::string& aClassName, UtScriptTypes* aScriptTypesPtr);
65 static bool EnumToString(std::string& aString, GeometryResult aGeometryResult);
67 static bool StringToEnum(GeometryResult& aGeometryResult,
const std::string& aString);
75 size_t aIntendedTargetIndex,
84 virtual bool Initialize(
double aSimTime,
WsfPlatform* aWeaponPlatformPtr);
88 virtual void Update(
double aSimTime);
91 void Terminate(
double aSimTime, GeometryResult aGeometryResult = cFAR_AWAY_IN_AIR);
96 if (mEffectPtr !=
nullptr)
104 void SetExtendedResult(
const std::string& aExtendedResult) { mExtendedResult = aExtendedResult; }
114 void SetWeaponEffects(
WsfStringId aWeaponEffectsType);
116 void SetInitialWeaponVelocityWCS(
const double aInitialVelWCS[3]);
118 void SetInitialTargetLocationWCS(
const double aInitialLocWCS[3]);
138 double GetElapsedTime(
double aSimTime)
const;
167 const WsfWeapon* GetWeaponSystem()
const;
190 size_t GetTargetPlatformIndex()
const;
221 void GetTargetLocationWCS(
WsfPlatform* aTargetPtr,
double aTargetLocWCS[3])
const;
222 void SetTargetLocationWCS(
WsfPlatform* aTargetPtr,
const double aTargetLocWCS[3]);
223 void GetWeaponLocationWCS(
WsfPlatform* aWeaponPtr,
double aWeaponLocWCS[3])
const;
224 void SetWeaponLocationWCS(
WsfPlatform* aWeaponPtr,
const double aWeaponLocWCS[3]);
226 void GetWeaponVelocityWCS(
double aWeaponVelWCS[3])
const;
227 void SetWeaponVelocityWCS(
const double aWeaponVelWCS[3]);
229 void GetTargetLocationAtLaunchWCS(
double aTargetLocWCS[3])
const;
230 void GetWeaponLocationAtLaunchWCS(
double aWeaponLocWCS[3])
const;
231 void GetWeaponVelocityAtLaunchWCS(
double aWeaponVelWCS[3])
const;
233 void GetWeaponLocationECS(
double aWeaponLocECS[3])
const;
234 void GetWeaponVelocityECS(
double aWeaponVelECS[3])
const;
236 double GetMissDistance(
WsfPlatform* aTargetPtr)
const;
257 void UpdateIntendedTarget()
const;
266 class TerminateEvent;
267 friend class TerminateEvent;
269 class TerminateEvent :
public WsfEvent
273 EventDisposition Execute()
override;
278 virtual void PrivateTerminate(
double aSimTime);
282 double mCompletionTime;
283 unsigned int mSerialNumber;
284 size_t mFiringPlatformIndex;
285 size_t mWeaponPlatformIndex;
286 mutable size_t mIntendedTargetIndex;
304 GeometryResult mGeometryResult;
307 std::string mExtendedResult;
310 double mWeaponLocAtLaunchWCS[3];
311 double mWeaponVelAtLaunchWCS[3];
315 double mWeaponVelWCS[3];
318 double mTargetLocAtLaunchWCS[3];
322 double mComputedWeaponLocWCS[3];
323 size_t mComputedWeaponIndex;
327 double mComputedTargetLocWCS[3];
328 size_t mComputedTargetIndex;
332 double mMissDistance;
335 bool mIsExternallyControlled;
345 bool mTerminatePending;
349 bool mDestroyPending;
352 bool mInitialWeaponVelocitySet;
355 bool mInitialTargetLocationSet;
aObjectPtr Update(simTime)
UtStringId WsfStringId
WsfStringId – the same thing as UtStringId.
Definition WsfStringId.hpp:23
Definition WsfEvent.hpp:29
The main controller for a simulation.
Definition WsfSimulation.hpp:109
Definition WsfTrackId.hpp:33
Definition WsfWeaponEffects.hpp:48
Result
Definition WsfWeaponEffects.hpp:63
Definition WsfWeaponEngagement.hpp:43
WsfWeaponEngagement(const WsfWeaponEngagement &aSrc)=delete
WsfSimulation * GetSimulation() const
Definition WsfWeaponEngagement.hpp:244
WsfStringId GetWeaponSystemName() const
Return the name of the firing weapon system (as a string ID).
Definition WsfWeaponEngagement.hpp:170
bool IsComplete() const
Return whether this engagement is complete.
Definition WsfWeaponEngagement.hpp:149
WsfWeaponEngagement & operator=(const WsfWeaponEngagement &aRhs)=delete
WsfStringId GetWeaponSystemType() const
Return the type of the firing weapon system (as a string ID).
Definition WsfWeaponEngagement.hpp:173
const char * GetScriptClassName() const override
Definition WsfWeaponEngagement.hpp:81
size_t GetFiringPlatformIndex() const
Return the platform index of the firing platform.
Definition WsfWeaponEngagement.hpp:163
void SetCompletionTime(double aCompletionTime)
Set the completion time of the engagement.
Definition WsfWeaponEngagement.hpp:146
GeometryResult GetGeometryResult() const
Definition WsfWeaponEngagement.hpp:206
std::string GetExtendedResult() const
Definition WsfWeaponEngagement.hpp:219
void SetIsExternallyControlled(bool aIsExternallyControlled)
Definition WsfWeaponEngagement.hpp:111
bool GetIFCEnabled() const
Returns 'true' if the platform supports IFC Integrated Fire Control).
Definition WsfWeaponEngagement.hpp:253
void SetIFCEnabled(bool aEnabled)
Set to true is IFC is supported.
Definition WsfWeaponEngagement.hpp:249
bool IsExternallyControlled() const
Is the engagement externally controlled?
Definition WsfWeaponEngagement.hpp:152
static void Delete(WsfWeaponEngagement *aEngagementPtr)
Definition WsfWeaponEngagement.cpp:172
size_t GetWeaponPlatformIndex() const
Definition WsfWeaponEngagement.hpp:179
unsigned int GetSerialNumber() const
Definition WsfWeaponEngagement.hpp:130
void Defeat()
Defeat the engagement (it will have no target effect after this call).
Definition WsfWeaponEngagement.hpp:94
WsfWeaponEngagement()=delete
WsfStringId GetIntendedTargetOffsetName() const
Definition WsfWeaponEngagement.hpp:196
WsfWeaponEffects::Result GetIncidentalResult() const
Definition WsfWeaponEngagement.hpp:215
WsfWeaponEffects::Result GetTargetResult() const
Definition WsfWeaponEngagement.hpp:210
double GetCompletionTime() const
Definition WsfWeaponEngagement.hpp:143
void SetExtendedResult(const std::string &aExtendedResult)
Definition WsfWeaponEngagement.hpp:104
double GetStartTime() const
Return the start time of the engagement.
Definition WsfWeaponEngagement.hpp:133
const WsfTrackId & GetInitialTargetTrackId() const
Definition WsfWeaponEngagement.hpp:186
GeometryResult
Definition WsfWeaponEngagement.hpp:46
@ cFAR_AWAY_ABOVE_GROUND
Above ground proximity burst not near any target.
Definition WsfWeaponEngagement.hpp:51
@ cFAR_AWAY_GROUND_IMPACT
Ground impact not near any target.
Definition WsfWeaponEngagement.hpp:52
@ cTARGET_PROXIMITY_AIR_BURST
Detonation was near a target, either in-air, or altitude unknown.
Definition WsfWeaponEngagement.hpp:53
@ cFAR_AWAY_IN_AIR
Air burst detonated far from any target.
Definition WsfWeaponEngagement.hpp:50
@ cPART_DISABLED_OR_DESTROYED
Temporary Lethal Effect on an attached platform part.
Definition WsfWeaponEngagement.hpp:56
@ cDUD
No lethal effect due to no detonation (failed to Arm, etc.).
Definition WsfWeaponEngagement.hpp:48
@ cIN_PROGRESS
Engagement not yet complete.
Definition WsfWeaponEngagement.hpp:47
@ cTARGET_PROXIMITY_ABOVE_GROUND
Above ground proximity burst near a target.
Definition WsfWeaponEngagement.hpp:54
@ cTARGET_IMPACT
Direct impact upon a target.
Definition WsfWeaponEngagement.hpp:49
@ cTARGET_PROXIMITY_GROUND_IMPACT
Impacted ground near a target.
Definition WsfWeaponEngagement.hpp:55
void SetMissDistance(double aMissDistance)
Definition WsfWeaponEngagement.hpp:241
WsfWeaponEffects * GetWeaponEffects() const
Access the WsfWeaponEffects model used during this engagement.
Definition WsfWeaponEngagement.hpp:126
Definition WsfWeapon.hpp:63