WSF
WsfWeaponEngagement Class Reference

#include <WsfWeaponEngagement.hpp>

Inherits UtScriptAccessible.

Public Types

enum  GeometryResult {
  cIN_PROGRESS , cDUD , cTARGET_IMPACT , cFAR_AWAY_IN_AIR ,
  cFAR_AWAY_ABOVE_GROUND , cFAR_AWAY_GROUND_IMPACT , cTARGET_PROXIMITY_AIR_BURST , cTARGET_PROXIMITY_ABOVE_GROUND ,
  cTARGET_PROXIMITY_GROUND_IMPACT , cPART_DISABLED_OR_DESTROYED
}

Public Member Functions

 WsfWeaponEngagement ()=delete
 WsfWeaponEngagement (double aStartTime, WsfSimulation *aSimulationPtr, WsfWeapon *aWeaponSystemPtr, const WsfTrackId &aTargetTrackId, size_t aIntendedTargetIndex, WsfStringId aWeaponEffectsType, WsfStringId aIntendedTargetOffsetName=WsfStringId())
const char * GetScriptClassName () const override

Static Public Member Functions

static WsfWeaponEngagementFind (const WsfPlatform &aPlatform)
static bool Assign (WsfPlatform &aPlatform, WsfWeaponEngagement *&aEngagementPtr)
static std::unique_ptr< UtScriptClass > CreateScriptClass (const std::string &aClassName, UtScriptTypes *aScriptTypesPtr)
static bool EnumToString (std::string &aString, GeometryResult aGeometryResult)
 Return the string equivalent of a GeometryResult enum.
static bool StringToEnum (GeometryResult &aGeometryResult, const std::string &aString)
 Return the GeomtryResult enum from a string.
static void Delete (WsfWeaponEngagement *aEngagementPtr)

Retrieve information about the results of the engagement.

class TerminateEvent
static void CopySerialNumber (const WsfWeaponEngagement *aRealEngPtr, WsfWeaponEngagement *aTempEngPtr)
GeometryResult GetGeometryResult () const
WsfWeaponEffects::Result GetTargetResult () const
WsfWeaponEffects::Result GetIncidentalResult () const
std::string GetExtendedResult () const
void GetTargetLocationWCS (WsfPlatform *aTargetPtr, double aTargetLocWCS[3]) const
void SetTargetLocationWCS (WsfPlatform *aTargetPtr, const double aTargetLocWCS[3])
void GetWeaponLocationWCS (WsfPlatform *aWeaponPtr, double aWeaponLocWCS[3]) const
void SetWeaponLocationWCS (WsfPlatform *aWeaponPtr, const double aWeaponLocWCS[3])
void GetWeaponVelocityWCS (double aWeaponVelWCS[3]) const
void SetWeaponVelocityWCS (const double aWeaponVelWCS[3])
 Set the terminal weapon velocity; used if there is no weapon platform in implicit engagements.
void GetTargetLocationAtLaunchWCS (double aTargetLocWCS[3]) const
void GetWeaponLocationAtLaunchWCS (double aWeaponLocWCS[3]) const
void GetWeaponVelocityAtLaunchWCS (double aWeaponVelWCS[3]) const
void GetWeaponLocationECS (double aWeaponLocECS[3]) const
void GetWeaponVelocityECS (double aWeaponVelECS[3]) const
double GetMissDistance (WsfPlatform *aTargetPtr) const
void SetMissDistance (double aMissDistance)
WsfSimulationGetSimulation () const
void SetIFCEnabled (bool aEnabled)
 Set to true is IFC is supported.
bool GetIFCEnabled () const
 Returns 'true' if the platform supports IFC Integrated Fire Control).
void UpdateIntendedTarget () const
 If the current target is different than the intended target, update the intended target.
 WsfWeaponEngagement (const WsfWeaponEngagement &aSrc)=delete
WsfWeaponEngagementoperator= (const WsfWeaponEngagement &aRhs)=delete
virtual ~WsfWeaponEngagement ()

Engagement control methods.

virtual bool Initialize (double aSimTime, WsfPlatform *aWeaponPlatformPtr)
bool Initialize (WsfPlatform *aWeaponPlatformPtr)
virtual void Update (double aSimTime)
void Terminate (double aSimTime, GeometryResult aGeometryResult=cFAR_AWAY_IN_AIR)
void Defeat ()
 Defeat the engagement (it will have no target effect after this call).
void SetExtendedResult (const std::string &aExtendedResult)
void SetIsExternallyControlled (bool aIsExternallyControlled)
void SetWeaponEffects (WsfStringId aWeaponEffectsType)
 Set the weapon effect model to be used for this engagement.
void SetInitialWeaponVelocityWCS (const double aInitialVelWCS[3])
void SetInitialTargetLocationWCS (const double aInitialLocWCS[3])

Retrieve general information about the engagement.

WsfWeaponEffectsGetWeaponEffects () const
 Access the WsfWeaponEffects model used during this engagement.
unsigned int GetSerialNumber () const
double GetStartTime () const
 Return the start time of the engagement.
double GetElapsedTime (double aSimTime) const
double GetCompletionTime () const
void SetCompletionTime (double aCompletionTime)
 Set the completion time of the engagement.
bool IsComplete () const
 Return whether this engagement is complete.
bool IsExternallyControlled () const
 Is the engagement externally controlled?

Retrieve information about the participants in the engagement.

WsfPlatformGetFiringPlatform () const
void SetFiringPlatform (WsfPlatform *aPlatform)
size_t GetFiringPlatformIndex () const
 Return the platform index of the firing platform.
WsfStringId GetFiringPlatformName () const
 Return the name (ID) of the firing platform.
const WsfWeaponGetWeaponSystem () const
WsfStringId GetWeaponSystemName () const
 Return the name of the firing weapon system (as a string ID).
WsfStringId GetWeaponSystemType () const
 Return the type of the firing weapon system (as a string ID).
WsfPlatformGetWeaponPlatform () const
size_t GetWeaponPlatformIndex () const
WsfStringId GetWeaponPlatformName () const
const WsfTrackIdGetInitialTargetTrackId () const
const WsfTrackIdGetTargetTrackId () const
size_t GetTargetPlatformIndex () const
WsfPlatformGetTargetPlatform () const
WsfStringId GetIntendedTargetName () const
WsfStringId GetIntendedTargetOffsetName () const

Detailed Description

A class to assist in keeping track of an ongoing weapon engagement and process its termination. While every simulated platform has a weapon engagement pointer, the pointer will be null except when engaging a target. An engagement is created and attached to a platform that either: 1) contains an employed weapon, or 2) is intended to be a lethal weapon platform. The WsfWeaponEngagement object always instantiates a valid WsfWeaponEffects object. For an explicit weapon, termination of the engagement (via the Terminate() method) is externally triggered by a WsfWeaponFuse. For an implicit weapon, such as a directed-energy device, the engagement may continuously damage platform(s) over time, so the owning implementation must call Update() periodically, and then Terminate() when the engagement is considered to be complete. An engagement is inextricably tied to the concept of an intended target; the WsfPlatform WsfTrackManager will supply the intended target to be considered by the WsfWeaponEffects object.

Member Enumeration Documentation

◆ GeometryResult

Enumerator
cIN_PROGRESS 

Engagement not yet complete.

cDUD 

No lethal effect due to no detonation (failed to Arm, etc.).

cTARGET_IMPACT 

Direct impact upon a target.

cFAR_AWAY_IN_AIR 

Air burst detonated far from any target.

cFAR_AWAY_ABOVE_GROUND 

Above ground proximity burst not near any target.

cFAR_AWAY_GROUND_IMPACT 

Ground impact not near any target.

cTARGET_PROXIMITY_AIR_BURST 

Detonation was near a target, either in-air, or altitude unknown.

cTARGET_PROXIMITY_ABOVE_GROUND 

Above ground proximity burst near a target.

cTARGET_PROXIMITY_GROUND_IMPACT 

Impacted ground near a target.

cPART_DISABLED_OR_DESTROYED 

Temporary Lethal Effect on an attached platform part.

Constructor & Destructor Documentation

◆ WsfWeaponEngagement() [1/3]

WsfWeaponEngagement::WsfWeaponEngagement ( )
delete

◆ WsfWeaponEngagement() [2/3]

WsfWeaponEngagement::WsfWeaponEngagement ( double aStartTime,
WsfSimulation * aSimulationPtr,
WsfWeapon * aWeaponSystemPtr,
const WsfTrackId & aTargetTrackId,
size_t aIntendedTargetIndex,
WsfStringId aWeaponEffectsType,
WsfStringId aIntendedTargetOffsetName = WsfStringId() )

Constructor for a new weapon engagement without a weapon platform.

Parameters
aStartTimeSimulation time at start of engagement.
aSimulationPtrPointer to the simulation
aWeaponSystemPtrPointer to the firing WsfWeapon system.
aTargetTrackIdThe track ID of the target from the Fire request.
aIntendedTargetIndexThe intended target (if known) for this engagement.
aWeaponEffectsTypeThe type of WsfWeaponEffects which this weapon will have upon its target.
aIntendedTargetOffsetNameA targeted sub-region of the intended target (e.g., "canopy", "irst", "stabilizer"). This sub-region must be recognized and used by the specified weapon effects type.

References cIN_PROGRESS, WsfPlatform::GetIndex(), WsfObject::GetName(), WsfObject::GetNameId(), WsfPlatformPart::GetPlatform(), WsfSimulation::GetPlatformByIndex(), WsfObject::GetTypeId(), WsfSimulation::NextEngagementSerialNumber(), and SetWeaponEffects().

◆ WsfWeaponEngagement() [3/3]

WsfWeaponEngagement::WsfWeaponEngagement ( const WsfWeaponEngagement & aSrc)
protecteddelete

References WsfWeaponEngagement().

◆ ~WsfWeaponEngagement()

WsfWeaponEngagement::~WsfWeaponEngagement ( )
protectedvirtual

Destructor. The destructor is protected from public use. Public callers must call Delete().

Member Function Documentation

◆ Assign()

bool WsfWeaponEngagement::Assign ( WsfPlatform & aPlatform,
WsfWeaponEngagement *& aEngagementPtr )
static

Assign the weapon engagement to the specified platform.

Parameters
aPlatform[input] The platform (representing the weapon) to whom the assignment is to be made.
aEngagementPtr[input] Pointer to the engagement object. [output] Set to zero if the return value is false. (the object was deleted)
Returns
'true' if successful or false if not.

References WsfWeaponPlatformExtension::SetWeaponEngagement(), and WsfWeaponEngagement().

Referenced by WsfExtDetonation::Execute(), WsfExplicitWeapon::FireP(), WsfWeaponFuse::PrivateDetonate(), WsfDisDirectedEnergyFire::Process(), and WsfDisFire::Process().

◆ CopySerialNumber()

void WsfWeaponEngagement::CopySerialNumber ( const WsfWeaponEngagement * aRealEngPtr,
WsfWeaponEngagement * aTempEngPtr )
static

Copy a serial number (should only be called by WsfExplicitWeapon).

Parameters
aRealEngPtrThe real engagement whose serial number is to be copied to the temporary engagement.
aTempEngPtrThe temporary engagement whose serial number is to be updated.

References GetSimulation(), WsfSimulation::PreviousEngagementSerialNumber(), WsfSimulation::ReclaimPreviousEngagementSerialNumber(), and WsfWeaponEngagement().

Referenced by WsfExplicitWeapon::FireP().

◆ CreateScriptClass()

std::unique_ptr< UtScriptClass > WsfWeaponEngagement::CreateScriptClass ( const std::string & aClassName,
UtScriptTypes * aScriptTypesPtr )
static

Create the 'class' object for the script system. This is invoked once by WsfScriptManager to create the 'class' object that defines the interface to instances of this class from the script system.

◆ Defeat()

void WsfWeaponEngagement::Defeat ( )
inline

Defeat the engagement (it will have no target effect after this call).

Referenced by Fires::DisObserver::ProcessPDU().

◆ Delete()

◆ EnumToString()

bool WsfWeaponEngagement::EnumToString ( std::string & aString,
GeometryResult aGeometryResult )
static

◆ Find()

◆ GetCompletionTime()

double WsfWeaponEngagement::GetCompletionTime ( ) const
inline

Return the completion time of the engagement.

Returns
The simulation time at which the engagement was declared to be complete. This value will be less than zero if the engagement is not yet complete.

Referenced by WsfImplicitWeapon::BeginEngagement(), and WeaponObserver::WeaponTerminated().

◆ GetElapsedTime()

double WsfWeaponEngagement::GetElapsedTime ( double aSimTime) const

Return the elapsed time for this engagement. The return value will grow from zero while the engagement is in progress, and will be fixed after the engagement is complete.

◆ GetExtendedResult()

std::string WsfWeaponEngagement::GetExtendedResult ( ) const
inline

Get the optional 'extended result' as provided by the weapon model. The weapon model may provide additional information as to why the weapon terminated.

Referenced by wsf::event::utils::PrintWE_Termination(), wsf::event::utilsCSV::PrintWE_Termination(), WsfL16::Interface_J11::WeaponTerminated(), and WsfMilEventPipe::WeaponTerminated().

◆ GetFiringPlatform()

◆ GetFiringPlatformIndex()

◆ GetFiringPlatformName()

WsfStringId WsfWeaponEngagement::GetFiringPlatformName ( ) const

◆ GetGeometryResult()

GeometryResult WsfWeaponEngagement::GetGeometryResult ( ) const
inline

Access the GeometryResult for this engagement after it is complete. The external entity that calls Terminate() will specify the end-game geometric result for this engagement.

Referenced by wsf::UCI_WeaponComponent::CommandWeapon(), WsfDisWeaponEvents::WeaponTerminated(), and WsfMilEventPipe::WeaponTerminated().

◆ GetIFCEnabled()

bool WsfWeaponEngagement::GetIFCEnabled ( ) const
inline

Returns 'true' if the platform supports IFC Integrated Fire Control).

◆ GetIncidentalResult()

WsfWeaponEffects::Result WsfWeaponEngagement::GetIncidentalResult ( ) const
inline

Access the WsfWeaponEffects::Result for this engagement after it is complete. This value of result applies only to platforms damaged incidentally (not the primary target).

Note
For computational expediency, many implementations will explicitly ignore incidental effects.

Referenced by wsf::event::utils::PrintWE_Termination(), and wsf::event::utilsCSV::PrintWE_Termination().

◆ GetInitialTargetTrackId()

const WsfTrackId & WsfWeaponEngagement::GetInitialTargetTrackId ( ) const
inline

Return the track ID of the target that was initially supplied on the Fire request.

Note
This will never change during the engagement, while the value returned by GetTargetTrackId may change.

Referenced by WsfWeapon::EngagementComplete(), WsfDisWeaponEvents::TransferPlatformToInternalControl(), WsfWeaponTaskManager::WeaponFired(), and WsfWeaponTaskManager::WeaponTerminated().

◆ GetIntendedTargetName()

WsfStringId WsfWeaponEngagement::GetIntendedTargetName ( ) const

Return the platform name of the target.

Note
This will be zero if there is no specific target.

References UpdateIntendedTarget().

Referenced by WsfMilEventPipe::WeaponFired(), and WsfMilEventPipe::WeaponTerminated().

◆ GetIntendedTargetOffsetName()

WsfStringId WsfWeaponEngagement::GetIntendedTargetOffsetName ( ) const
inline

◆ GetMissDistance()

double WsfWeaponEngagement::GetMissDistance ( WsfPlatform * aTargetPtr) const

Get the miss distance between the weapon and the target. This will return the first of the following available distances:

  • If the weapon model provided a miss distance and the distance was provided for the target under consideration, distance, use the declared miss distance.
  • If the weapon model provided actual weapon and target locations at PCA and the target under consideration was the same as the one for which the target location was computed, use use the distance between the actual locations.
  • Otherwise use the current distance between the weapon and the target. Note that this may not be the actual PCA because most weapon models go one timestep past PCA before declaring intercept.
    Parameters
    aTargetPtrThe pointer to the target in question. If 0 then it will use the current target platform.
    Returns
    The miss distance in meters.

References WsfPlatform::GetIndex(), WsfSimulation::GetPlatformByIndex(), GetSimulation(), GetTargetLocationWCS(), GetTargetPlatformIndex(), GetWeaponLocationWCS(), GetWeaponPlatformIndex(), and targetIndex().

Referenced by WsfGraduatedLethality::CalcInterceptPk(), WsfExplicitWeaponEffects::IsVulnerable(), wsf::event::utils::PrintWE_RelativeGeometry(), wsf::event::utilsCSV::PrintWE_RelativeGeometry(), WsfDisWeaponEvents::WeaponTerminated(), and WsfMilEventPipe::WeaponTerminated().

◆ GetScriptClassName()

const char * WsfWeaponEngagement::GetScriptClassName ( ) const
inlineoverride

◆ GetSerialNumber()

◆ GetSimulation()

◆ GetStartTime()

◆ GetTargetLocationAtLaunchWCS()

void WsfWeaponEngagement::GetTargetLocationAtLaunchWCS ( double aTargetLocWCS[3]) const

Get the location of the intended target at the time of launch.

Parameters
aTargetLocWCS[output] The true location of the intended at the time of launch.
Note
The location will be {0,0,0} if there was no intended target tat the time of launch, and the initial location was not set prior to initialization.

Referenced by Fires::BallisticPlatforms::CreatePlatform(), and Fires::Observer::WeaponFired().

◆ GetTargetLocationWCS()

void WsfWeaponEngagement::GetTargetLocationWCS ( WsfPlatform * aTargetPtr,
double aTargetLocWCS[3] ) const

Get the location of the target at the time the engagement was terminated.

Parameters
aTargetPtr[input] The pointer to the target platform.
[aTargetLocWCS[output] The computed target location as established by SetTargetLocationWCS or the current target location on the computed location was not defined or not appropriate.

References WsfPlatform::GetIndex(), WsfPlatform::GetLastUpdateTime(), GetSimulation(), and WsfPlatform::Update().

Referenced by WsfCarltonLethality::CalcInterceptPk(), WsfGraduatedLethality::CalcInterceptPk(), WsfExplicitWeaponEffects::CalcPkParameters(), GetMissDistance(), GetWeaponLocationECS(), wsf::event::utils::PrintWE_RelativeGeometry(), wsf::event::utilsCSV::PrintWE_RelativeGeometry(), and WsfDisWeaponEvents::WeaponTerminated().

◆ GetTargetPlatform()

◆ GetTargetPlatformIndex()

◆ GetTargetResult()

WsfWeaponEffects::Result WsfWeaponEngagement::GetTargetResult ( ) const
inline

Access the WsfWeaponEffects::Result for this engagement after it is complete. This value of result applies only to the intended target of the engagement.

Referenced by WsfDisWeaponEvents::DirectedEnergyWeaponHit(), wsf::event::utils::PrintWE_Termination(), wsf::event::utilsCSV::PrintWE_Termination(), WeaponObserver::WeaponTerminated(), and WsfDisWeaponEvents::WeaponTerminated().

◆ GetTargetTrackId()

const WsfTrackId & WsfWeaponEngagement::GetTargetTrackId ( ) const

Return the track ID of the current target track.

Note
This will be a null ID if there is no current target.
This return value is typically different than the value returned by GetInitialTargetTrackId. That value represents the track ID as seen by the firing platform while this value represents the track ID as seen by the weapon platform.

References UpdateIntendedTarget().

Referenced by WsfRIPRProcessor::WeaponFired(), WsfRIPRProcessor::WeaponHit(), WsfRIPRProcessor::WeaponMissed(), and WsfRIPRProcessor::WeaponTerminated().

◆ GetWeaponEffects()

◆ GetWeaponLocationAtLaunchWCS()

void WsfWeaponEngagement::GetWeaponLocationAtLaunchWCS ( double aWeaponLocWCS[3]) const

Get the location of the weapon at the time of launch.

Parameters
aWeaponLocWCS[output] The true location of the weapon at the time of launch. If the weapon is an implicit weapon then it will be the location of the firing platform.

◆ GetWeaponLocationECS()

void WsfWeaponEngagement::GetWeaponLocationECS ( double aWeaponLocECS[3]) const

Get the location of the weapon relative to the target.

Parameters
aWeaponLocECS[output] The location of the weapon, relative to its target. Intended for use at time of weapon termination.

References GetTargetLocationWCS(), GetTargetPlatform(), GetWeaponLocationWCS(), and GetWeaponPlatform().

◆ GetWeaponLocationWCS()

void WsfWeaponEngagement::GetWeaponLocationWCS ( WsfPlatform * aWeaponPtr,
double aWeaponLocWCS[3] ) const

Get the location of the weapon at the time the engagement was terminated.

Parameters
aWeaponPtr[input] The pointer to the weapon platform.
aWeaponLocWCS[output] The computed weapon location as established by SetWeaponLocationWCS or the current weapon location on the computed location was not defined or not appropriate.

References WsfPlatform::GetIndex(), WsfPlatform::GetLastUpdateTime(), GetSimulation(), and WsfPlatform::Update().

Referenced by WsfCarltonLethality::CalcInterceptPk(), WsfGraduatedLethality::CalcInterceptPk(), WsfExplicitWeaponEffects::CalcPkParameters(), GetMissDistance(), GetWeaponLocationECS(), wsf::event::utils::PrintWE_RelativeGeometry(), wsf::event::utilsCSV::PrintWE_RelativeGeometry(), and WsfDisWeaponEvents::WeaponTerminated().

◆ GetWeaponPlatform()

◆ GetWeaponPlatformIndex()

◆ GetWeaponPlatformName()

WsfStringId WsfWeaponEngagement::GetWeaponPlatformName ( ) const

Return the name (ID) of the weapon platform.

Note
This will be zero for an implicit weapon.

References WsfSimulation::GetPlatformNameId(), and GetSimulation().

Referenced by wsf::event::utils::PrintWE_PlayerData(), and wsf::event::utilsCSV::PrintWE_PlayerData().

◆ GetWeaponSystem()

◆ GetWeaponSystemName()

◆ GetWeaponSystemType()

WsfStringId WsfWeaponEngagement::GetWeaponSystemType ( ) const
inline

Return the type of the firing weapon system (as a string ID).

◆ GetWeaponVelocityAtLaunchWCS()

void WsfWeaponEngagement::GetWeaponVelocityAtLaunchWCS ( double aWeaponVelWCS[3]) const

Get the velocity of the weapon at the time of launch.

Parameters
aWeaponVelWCS[output] The velocity of the weapon at the time of launch. If the weapon is an implicit weapon then it will either be the velocity of the firing platform (as in the case of a high-energy laser), or an estimate of the velocity that a corresponding explicit weapon would have (as in the case of an indirect fire weapon such as a mortar).

◆ GetWeaponVelocityECS()

void WsfWeaponEngagement::GetWeaponVelocityECS ( double aWeaponVelECS[3]) const
Parameters
aWeaponVelECS[output] The velocity of the weapon, relative to its target. Intended for use at time of weapon termination.

References GetTargetPlatform(), GetWeaponPlatform(), and GetWeaponVelocityWCS().

◆ GetWeaponVelocityWCS()

void WsfWeaponEngagement::GetWeaponVelocityWCS ( double aWeaponVelWCS[3]) const

◆ Initialize() [1/2]

bool WsfWeaponEngagement::Initialize ( double aSimTime,
WsfPlatform * aWeaponPlatformPtr )
virtual

Initialize the engagement with the weapon platform.

Parameters
aSimTimeThe current simulation time.
aWeaponPlatformPtrPointer to the weapon platform or 0 if the weapon is not a platform.
Returns
'true' if successfully initialized

References WsfPlatform::GetIndex(), WsfSimulation::GetPlatformByIndex(), GetSimulation(), platformPtr, and success.

Referenced by WsfImplicitWeapon::BeginEngagement(), WsfExtDetonation::Execute(), Initialize(), WsfDisDirectedEnergyFire::Process(), and WsfDisFire::Process().

◆ Initialize() [2/2]

bool WsfWeaponEngagement::Initialize ( WsfPlatform * aWeaponPlatformPtr)

An alternative form of Initialize that does not modify the engagement start time.

Parameters
aWeaponPlatformPtrPointer to the weapon platform or 0 if the weapon is not a platform.
Returns
'true' if successfully initialized

References Initialize().

◆ IsComplete()

bool WsfWeaponEngagement::IsComplete ( ) const
inline

Return whether this engagement is complete.

Referenced by WsfImplicitWeapon::TerminateEngagementEvent::Execute().

◆ IsExternallyControlled()

bool WsfWeaponEngagement::IsExternallyControlled ( ) const
inline

Is the engagement externally controlled?

Referenced by WsfDisWeaponEvents::DirectedEnergyWeaponFired(), and WsfDisWeaponEvents::WeaponTerminated().

◆ operator=()

WsfWeaponEngagement & WsfWeaponEngagement::operator= ( const WsfWeaponEngagement & aRhs)
protecteddelete

References WsfWeaponEngagement().

◆ SetCompletionTime()

void WsfWeaponEngagement::SetCompletionTime ( double aCompletionTime)
inline

Set the completion time of the engagement.

Referenced by WsfImplicitWeapon::BeginEngagement(), and WsfWeaponFuse::PrivateDetonate().

◆ SetExtendedResult()

void WsfWeaponEngagement::SetExtendedResult ( const std::string & aExtendedResult)
inline

Set the optional 'extended result'. The weapon model may call this routine to pass along additional information as to why the weapon terminated.

Referenced by WsfWeaponTaskManager::AbortFiring(), WsfWeaponFuse::PrivateDetonate(), and WsfWeaponTrackProcessor::Update().

◆ SetFiringPlatform()

void WsfWeaponEngagement::SetFiringPlatform ( WsfPlatform * aFiringPlatformPtr)

Set the pointer to the firing platform. This is used when there is not an associated weapon system that is passed on the constructor. It is typically used when the firing platform is an externally controlled entity where we probably aren't explicitly modeling the launching subsystem.

See also
WsfDisFire and WsfDisDetonation for examples.

References WsfPlatform::GetIndex().

Referenced by WsfExtDetonation::Execute(), and WsfDisFire::Process().

◆ SetIFCEnabled()

void WsfWeaponEngagement::SetIFCEnabled ( bool aEnabled)
inline

Set to true is IFC is supported.

Referenced by WsfExplicitWeapon::FireP().

◆ SetInitialTargetLocationWCS()

void WsfWeaponEngagement::SetInitialTargetLocationWCS ( const double aInitialLocWCS[3])

Set the initial target location. This is done for engagements with no initial intended target a mortar or artillery launcher.

Referenced by WsfImplicitWeapon::BeginEngagement(), and WsfExplicitWeapon::FireP().

◆ SetInitialWeaponVelocityWCS()

void WsfWeaponEngagement::SetInitialWeaponVelocityWCS ( const double aInitialVelWCS[3])

Set the initial weapon velocity. This is done for implicit weapons that behave like explicit ones, such as a mortar or artillery launcher.

Referenced by WsfDirectedEnergyWeapon::BeginEngagement(), and WsfImplicitWeapon::BeginEngagement().

◆ SetIsExternallyControlled()

void WsfWeaponEngagement::SetIsExternallyControlled ( bool aIsExternallyControlled)
inline

Define the externally controlled attribute of the engagement. This is typically called by some interfaces to external simulations when it receives an engagement from the external simulation (e.g.: WsfDisFire/WsfDisDetonation).

Parameters
aIsExternallyControlled'true' if the engagement is controlled by an external simulation.

Referenced by WsfExtDetonation::Execute(), WsfDisDirectedEnergyFire::Process(), and WsfDisFire::Process().

◆ SetMissDistance()

void WsfWeaponEngagement::SetMissDistance ( double aMissDistance)
inline

Sets the miss distance as provided by the weapon model.

Parameters
aMissDistanceMiss distance (meters).
See also
GetMissDistance for more information.

Referenced by WsfWeaponFuse::PrivateDetonate().

◆ SetTargetLocationWCS()

void WsfWeaponEngagement::SetTargetLocationWCS ( WsfPlatform * aTargetPtr,
const double aTargetLocWCS[3] )

Set the location of the target at the time the engagement is terminated. Objects such as a fuse must often determine the actual location AFTER the weapon has moved passed the point of detonation. This method provides the fuse a method for defining where the target would have been when the fuse would have actually detonated.

Parameters
aTargetPtr[input] Pointer to the target platform.
aTargetLocWCS[input] The true location of the target at the time of engagement termination.

References WsfPlatform::GetIndex().

Referenced by WsfDirectedEnergyWeapon::EngagementComplete(), WsfImplicitWeapon::EngagementComplete(), WsfExtDetonation::Execute(), and WsfWeaponFuse::PrivateDetonate().

◆ SetWeaponEffects()

void WsfWeaponEngagement::SetWeaponEffects ( WsfStringId aWeaponEffectsType)

Set the weapon effect model to be used for this engagement.

Set the weapon effects to be used when the engagement is terminated.

Parameters
aWeaponEffectsTypeThe name of the weapon effects to be used.

References WsfObjectTypeList< T >::Clone(), and WsfWeaponEffectsTypes::Get().

Referenced by WsfExtDetonation::Execute(), and WsfWeaponEngagement().

◆ SetWeaponLocationWCS()

void WsfWeaponEngagement::SetWeaponLocationWCS ( WsfPlatform * aWeaponPtr,
const double aWeaponLocWCS[3] )

Set the location of the weapon at the time the engagement is terminated. Objects such as a fuse must often determine the actual location AFTER the weapon has moved passed the point of detonation. This method provides the fuse a method for defining where the weapon would have been when the fuse would have actually detonated.

Parameters
aWeaponPtr[input] Pointer to the weapon platform.
aWeaponLocWCS[input] The true location of the weapon at the time of engagement termination.

References WsfPlatform::GetIndex().

Referenced by WsfExtDetonation::Execute(), WsfWeaponFuse::PrivateDetonate(), and WsfDisFire::Process().

◆ SetWeaponVelocityWCS()

void WsfWeaponEngagement::SetWeaponVelocityWCS ( const double aWeaponVelWCS[3])

Set the terminal weapon velocity; used if there is no weapon platform in implicit engagements.

Referenced by WsfDirectedEnergyWeapon::EngagementComplete(), and WsfImplicitWeapon::EngagementComplete().

◆ StringToEnum()

bool WsfWeaponEngagement::StringToEnum ( GeometryResult & aGeometryResult,
const std::string & aString )
static

◆ Terminate()

void WsfWeaponEngagement::Terminate ( double aSimTime,
GeometryResult aGeometryResult = cFAR_AWAY_IN_AIR )

Terminate the engagement. If the geometry result indicates that it isn't a dud, then the applicable WsfWeaponEffects effect on platforms in the vicinity of the weapon's lethal area will be applied.

Parameters
aSimTimeCurrent simulated time at engagement termination.
aGeometryResultA preliminary assessment of the closeness of the hit, based upon geometry. The weapon effects object may override this preliminary assessment with a better one.

References WsfSimulation::AddEvent(), WsfSimulation::cCOMPLETE, and GetSimulation().

Referenced by WsfWeaponTaskManager::AbortFiring(), WsfExtDetonation::Execute(), WsfImplicitWeapon::TerminateEngagementEvent::Execute(), WsfGuidedMoverBase::PrelaunchAdvanceTime(), WsfWeaponFuse::PrivateDetonate(), Fires::DisObserver::ProcessPDU(), Fires::FiresMover::Update(), Update(), WsfWeaponTrackProcessor::Update(), and WsfPlatformScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT().

◆ Update()

void WsfWeaponEngagement::Update ( double aSimTime)
virtual

Virtual base method to evaluate an engagement (primarily applies to implicit weapons). Base implementation is to continue the engagement until the target is dead. The owning implementation may choose to end the engagement earlier, via Terminate().

Parameters
aSimTimeCurrent simulated time for engagement evaluation.

References WsfWeaponEffects::cKILLED, and Terminate().

Referenced by WsfDisDirectedEnergyFire::Process(), and WsfImplicitWeapon::Update().

◆ UpdateIntendedTarget()

void WsfWeaponEngagement::UpdateIntendedTarget ( ) const
protected

◆ TerminateEvent

friend class TerminateEvent
friend

References WsfWeaponEngagement().


The documentation for this class was generated from the following files:
Copyrights Multiple, All Rights Reserved