|
WSF
|
#include <WsfWeaponEngagement.hpp>
Inherits UtScriptAccessible.
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 WsfWeaponEngagement * | Find (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) |
| WsfSimulation * | GetSimulation () 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 | |
| WsfWeaponEngagement & | operator= (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. | |
| WsfWeaponEffects * | GetWeaponEffects () 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. | |
| WsfPlatform * | GetFiringPlatform () 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 WsfWeapon * | GetWeaponSystem () 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). | |
| WsfPlatform * | GetWeaponPlatform () const |
| size_t | GetWeaponPlatformIndex () const |
| WsfStringId | GetWeaponPlatformName () const |
| const WsfTrackId & | GetInitialTargetTrackId () const |
| const WsfTrackId & | GetTargetTrackId () const |
| size_t | GetTargetPlatformIndex () const |
| WsfPlatform * | GetTargetPlatform () const |
| WsfStringId | GetIntendedTargetName () const |
| WsfStringId | GetIntendedTargetOffsetName () const |
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.
|
delete |
References Delete(), and WsfWeaponEngagement().
Referenced by Assign(), CopySerialNumber(), Delete(), Find(), operator=(), TerminateEvent, WsfWeaponEngagement(), and WsfWeaponEngagement().
| 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.
| aStartTime | Simulation time at start of engagement. |
| aSimulationPtr | Pointer to the simulation |
| aWeaponSystemPtr | Pointer to the firing WsfWeapon system. |
| aTargetTrackId | The track ID of the target from the Fire request. |
| aIntendedTargetIndex | The intended target (if known) for this engagement. |
| aWeaponEffectsType | The type of WsfWeaponEffects which this weapon will have upon its target. |
| aIntendedTargetOffsetName | A 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().
|
protecteddelete |
References WsfWeaponEngagement().
|
protectedvirtual |
Destructor. The destructor is protected from public use. Public callers must call Delete().
|
static |
Assign the weapon engagement to the specified platform.
| 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) |
References WsfWeaponPlatformExtension::SetWeaponEngagement(), and WsfWeaponEngagement().
Referenced by WsfExtDetonation::Execute(), WsfExplicitWeapon::FireP(), WsfWeaponFuse::PrivateDetonate(), WsfDisDirectedEnergyFire::Process(), and WsfDisFire::Process().
|
static |
Copy a serial number (should only be called by WsfExplicitWeapon).
| aRealEngPtr | The real engagement whose serial number is to be copied to the temporary engagement. |
| aTempEngPtr | The temporary engagement whose serial number is to be updated. |
References GetSimulation(), WsfSimulation::PreviousEngagementSerialNumber(), WsfSimulation::ReclaimPreviousEngagementSerialNumber(), and WsfWeaponEngagement().
Referenced by WsfExplicitWeapon::FireP().
|
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.
|
inline |
Defeat the engagement (it will have no target effect after this call).
Referenced by Fires::DisObserver::ProcessPDU().
|
static |
Request deletion of the engagement object. This is the public interface to delete an engagement object.
References WsfSimulation::cCOMPLETE, GetSimulation(), WsfSimulation::GetState(), WsfWeaponPlatformExtension::GetWeaponEngagement(), GetWeaponPlatform(), WsfWeaponPlatformExtension::SetWeaponEngagement(), and WsfWeaponEngagement().
Referenced by WsfImplicitWeapon::BeginEngagement(), WsfExtDetonation::Execute(), WsfDisFire::Process(), WsfWeaponPlatformExtension::SetWeaponEngagement(), WsfWeaponEngagement(), WsfImplicitWeapon::EngagementData::~EngagementData(), WsfMilDisInterface::~WsfMilDisInterface(), and WsfWeaponPlatformExtension::~WsfWeaponPlatformExtension().
|
static |
Return the string equivalent of a GeometryResult enum.
References cDUD, cFAR_AWAY_ABOVE_GROUND, cFAR_AWAY_GROUND_IMPACT, cFAR_AWAY_IN_AIR, cIN_PROGRESS, cTARGET_IMPACT, cTARGET_PROXIMITY_ABOVE_GROUND, cTARGET_PROXIMITY_AIR_BURST, cTARGET_PROXIMITY_GROUND_IMPACT, and ok.
Referenced by wsf::UCI_WeaponComponent::CommandWeapon(), and WsfWeaponFuse::PrivateDetonate().
|
static |
References WsfWeaponPlatformExtension::GetWeaponEngagement(), and WsfWeaponEngagement().
Referenced by WsfWeaponTaskManager::AbortFiring(), WsfExplicitWeapon::AddWeaponToSimulation(), WsfTowedMover::CleanUpStowedAsset(), engage::Task::Execute(), WsfExtDetonation::Execute(), WsfTowedMover::Initialize(), WsfWeaponFuse::Initialize(), WsfGuidedMoverBase::Initialize2(), WsfDisWeaponEvents::IsOutgoingWeaponTransfer(), WsfWeaponServer::PlatformAdded(), WsfWeaponServer::PlatformDeleted(), WsfWeaponServer::PlatformInitialized(), WsfGuidedMoverBase::PrelaunchAdvanceTime(), WsfWeaponFuse::PrivateDetonate(), WsfWeaponServer::SetCommander(), WsfRIPRProcessor::StartUplinking(), WsfRIPRProcessor::StartUplinking(), WsfUplinkProcessor::StartUplinking(), WsfRIPRProcessor::StopUplinking(), WsfUplinkProcessor::StopUplinking(), WsfDisWeaponEvents::TransferPlatformToInternalControl(), Fires::FiresMover::Update(), WsfWeaponTrackProcessor::Update(), WsfPlatformScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT(), and WsfPlatformScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT().
|
inline |
Return the completion time of the engagement.
Referenced by WsfImplicitWeapon::BeginEngagement(), and WeaponObserver::WeaponTerminated().
| 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.
|
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().
| WsfPlatform * WsfWeaponEngagement::GetFiringPlatform | ( | ) | const |
Return a pointer to the firing platform.
References WsfSimulation::GetPlatformByIndex(), and GetSimulation().
Referenced by WsfEngageLaunchPkTableLethality::CalcLaunchPk(), WsfWeaponEffects::CalcPkParameters(), Fires::BallisticPlatforms::CreatePlatform(), WsfDisWeaponEvents::DirectedEnergyWeaponFired(), WsfDirectedEnergyWeapon::EngagementComplete(), WsfWeaponServer::GenerateCommand(), GetWeaponSystem(), WsfTowedMover::Initialize(), WsfWeaponEffects::IsVulnerable(), WsfWeaponServer::PlatformInitialized(), WsfWeaponServer::SetCommander(), Fires::Observer::WeaponFired(), WeaponObserver::WeaponFired(), WsfL16::Interface_J11::WeaponFired(), WsfMilEventPipe::WeaponFired(), Fires::Observer::WeaponTerminated(), WeaponObserver::WeaponTerminated(), and WsfMilEventPipe::WeaponTerminated().
|
inline |
Return the platform index of the firing platform.
Referenced by WsfDisWeaponEvents::DirectedEnergyWeaponFired(), WsfWeaponServer::GenerateCommand(), WsfWeaponFuse::Initialize(), WsfGuidedMoverBase::Initialize2(), wsf::event::utils::PrintWE_PlayerData(), wsf::event::utilsCSV::PrintWE_PlayerData(), WsfRIPRProcessor::StopUplinking(), WsfUplinkProcessor::StopUplinking(), WsfDisWeaponEvents::TransferPlatformToInternalControl(), WsfMilEventPipe::WeaponFired(), WsfRIPRProcessor::WeaponFired(), WsfWeaponTaskManager::WeaponFired(), WsfRIPRProcessor::WeaponHit(), WsfRIPRProcessor::WeaponMissed(), WsfDisWeaponEvents::WeaponTerminated(), WsfMilEventPipe::WeaponTerminated(), and WsfRIPRProcessor::WeaponTerminated().
| WsfStringId WsfWeaponEngagement::GetFiringPlatformName | ( | ) | const |
Return the name (ID) of the firing platform.
References WsfSimulation::GetPlatformNameId(), and GetSimulation().
Referenced by WsfWeaponServer::GenerateCommand(), WsfTowedMover::Initialize(), wsf::event::utils::PrintWE_PlayerData(), and wsf::event::utilsCSV::PrintWE_PlayerData().
|
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().
|
inline |
Returns 'true' if the platform supports IFC Integrated Fire Control).
|
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).
Referenced by wsf::event::utils::PrintWE_Termination(), and wsf::event::utilsCSV::PrintWE_Termination().
|
inline |
Return the track ID of the target that was initially supplied on the Fire request.
Referenced by WsfWeapon::EngagementComplete(), WsfDisWeaponEvents::TransferPlatformToInternalControl(), WsfWeaponTaskManager::WeaponFired(), and WsfWeaponTaskManager::WeaponTerminated().
| WsfStringId WsfWeaponEngagement::GetIntendedTargetName | ( | ) | const |
Return the platform name of the target.
References UpdateIntendedTarget().
Referenced by WsfMilEventPipe::WeaponFired(), and WsfMilEventPipe::WeaponTerminated().
|
inline |
Referenced by WsfHEL_Lethality::ApplyEffectTo(), and WsfHEL_Lethality::FindMappedEntry().
| 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:
| aTargetPtr | The pointer to the target in question. If 0 then it will use the current target platform. |
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().
|
inlineoverride |
|
inline |
Get the serial number assigned to this weapon event. Each weapon engagement has a unique serial number.
Referenced by WsfExplicitWeapon::AddWeaponToSimulation(), WsfImplicitWeapon::BeginEngagement(), wsf::UCI_WeaponComponent::CommandWeapon(), WsfDisWeaponEvents::DirectedEnergyWeaponFired(), WsfDisWeaponEvents::DirectedEnergyWeaponHit(), WsfWeapon::EngagementComplete(), WsfDisWeaponEvents::ImplicitWeaponEndEngagement(), WsfDisWeaponEvents::InitiateWeaponTransfer(), wsf::event::utils::PrintWE_PlayerData(), wsf::event::utilsCSV::PrintWE_PlayerData(), Fires::DisObserver::ProcessFirePDU(), WsfRIPRProcessor::StartUplinking(), WsfRIPRProcessor::StartUplinking(), WsfUplinkProcessor::StartUplinking(), Fires::Observer::WeaponFired(), WsfRIPRProcessor::WeaponFired(), WsfWeaponTaskManager::WeaponFired(), Fires::Observer::WeaponTerminated(), WsfDisWeaponEvents::WeaponTerminated(), and WsfRIPRProcessor::WeaponTerminated().
|
inline |
|
inline |
Return the start time of the engagement.
Referenced by WsfDisWeaponEvents::DirectedEnergyWeaponFired(), wsf::event::utils::PrintWE_PlayerData(), wsf::event::utilsCSV::PrintWE_Termination(), WsfDisWeaponEvents::TransferPlatformToInternalControl(), and WsfImplicitWeapon::Update().
| void WsfWeaponEngagement::GetTargetLocationAtLaunchWCS | ( | double | aTargetLocWCS[3] | ) | const |
Get the location of the intended target at the time of launch.
| aTargetLocWCS | [output] The true location of the intended at the time of launch. |
Referenced by Fires::BallisticPlatforms::CreatePlatform(), and Fires::Observer::WeaponFired().
| void WsfWeaponEngagement::GetTargetLocationWCS | ( | WsfPlatform * | aTargetPtr, |
| double | aTargetLocWCS[3] ) const |
Get the location of the target at the time the engagement was terminated.
| 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().
| WsfPlatform * WsfWeaponEngagement::GetTargetPlatform | ( | ) | const |
Return a pointer to the target platform.
References WsfSimulation::GetPlatformByIndex(), GetSimulation(), and UpdateIntendedTarget().
Referenced by WsfMobilityAndFirepowerLethality::AddInitialCM_States(), WsfEngageLaunchPkTableLethality::CalcLaunchPk(), WsfWeaponEffects::CalcLaunchPk(), WsfWeaponEffects::CalcPkParameters(), WsfDirectedEnergyWeapon::EngagementComplete(), WsfImplicitWeapon::EngagementComplete(), WsfWeaponServer::GenerateCommand(), GetWeaponLocationECS(), GetWeaponVelocityECS(), WsfHEL_Lethality::Initialize(), WsfMobilityAndFirepowerLethality::Initialize(), and WsfMobilityAndFirepowerLethality::WeaponFired().
| size_t WsfWeaponEngagement::GetTargetPlatformIndex | ( | ) | const |
Return the platform index of the target.
References UpdateIntendedTarget().
Referenced by WsfDisWeaponEvents::DirectedEnergyWeaponFired(), WsfDisWeaponEvents::DirectedEnergyWeaponHit(), WsfExtDetonation::Execute(), WsfWeaponServer::GenerateCommand(), GetMissDistance(), wsf::event::utils::PrintWE_PlayerData(), wsf::event::utilsCSV::PrintWE_PlayerData(), WsfBallisticMissileLaunchComputer::WeaponFired(), WsfMilEventPipe::WeaponFired(), WsfRIPRProcessor::WeaponFired(), WsfWeaponTaskManager::WeaponFired(), WsfDisWeaponEvents::WeaponTerminated(), WsfL16::Interface_J11::WeaponTerminated(), and WsfMilEventPipe::WeaponTerminated().
|
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().
| const WsfTrackId & WsfWeaponEngagement::GetTargetTrackId | ( | ) | const |
Return the track ID of the current target track.
References UpdateIntendedTarget().
Referenced by WsfRIPRProcessor::WeaponFired(), WsfRIPRProcessor::WeaponHit(), WsfRIPRProcessor::WeaponMissed(), and WsfRIPRProcessor::WeaponTerminated().
|
inline |
Access the WsfWeaponEffects model used during this engagement.
Referenced by WsfLaserWeapon::BeginShot(), engage::SummaryData::EngagementResult(), engage::Task::Execute(), wsf::event::utils::GetAdditionalDE_Info(), wsf::event::utilsCSV::GetAdditionalDE_Info(), wsf::event::utils::PrintWE_Termination(), wsf::event::utilsCSV::PrintWE_Termination(), and WsfMilEventPipe::WeaponTerminated().
| void WsfWeaponEngagement::GetWeaponLocationAtLaunchWCS | ( | double | aWeaponLocWCS[3] | ) | const |
Get the location of the weapon at the time of launch.
| 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. |
| void WsfWeaponEngagement::GetWeaponLocationECS | ( | double | aWeaponLocECS[3] | ) | const |
Get the location of the weapon relative to the target.
| 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().
| void WsfWeaponEngagement::GetWeaponLocationWCS | ( | WsfPlatform * | aWeaponPtr, |
| double | aWeaponLocWCS[3] ) const |
Get the location of the weapon at the time the engagement was terminated.
| 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().
| WsfPlatform * WsfWeaponEngagement::GetWeaponPlatform | ( | ) | const |
Return a pointer to the weapon platform.
References WsfSimulation::GetPlatformByIndex(), and GetSimulation().
Referenced by WsfMobilityAndFirepowerLethality::AddInitialCM_States(), WsfExplicitWeaponEffects::CalcInterceptGeometry(), WsfCarltonLethality::CalcInterceptPk(), WsfGraduatedLethality::CalcInterceptPk(), WsfExplicitWeaponEffects::CalcPkParameters(), Delete(), WsfMobilityAndFirepowerLethality::Detonate(), GetWeaponLocationECS(), GetWeaponVelocityECS(), WsfDisWeaponEvents::InitiateWeaponTransfer(), WsfExplicitWeaponEffects::IsVulnerable(), WsfWeaponEffects::IsVulnerable(), WsfMobilityAndFirepowerLethality::MyFullName(), WsfExoAtmosphericLethality::PreInitialize(), WsfWeaponEffects::ProcessEffectExplicit(), WsfExoAtmosphericLethality::Terminate(), WsfWeaponEffects::Terminate(), UpdateIntendedTarget(), engage::SimulationExtension::WeaponFired(), Fires::Observer::WeaponFired(), WsfL16::Interface_J11::WeaponFired(), WsfMobilityAndFirepowerLethality::WeaponFired(), WsfWeaponTaskManager::WeaponFired(), engage::SimulationExtension::WeaponHit(), engage::SimulationExtension::WeaponMissed(), engage::SimulationExtension::WeaponTerminated(), WsfDisWeaponEvents::WeaponTerminated(), and WsfL16::Interface_J11::WeaponTerminated().
|
inline |
Return the platform index of the launched weapon platform. This will be 0 if this is an implicitly modeled weapon.
Referenced by WsfExplicitWeapon::AddWeaponToSimulation(), GetMissDistance(), wsf::event::utils::PrintWE_PlayerData(), wsf::event::utilsCSV::PrintWE_PlayerData(), WeaponObserver::WeaponFired(), WsfMilEventPipe::WeaponFired(), WsfRIPRProcessor::WeaponFired(), WsfWeaponTaskManager::WeaponFired(), WeaponObserver::WeaponTerminated(), WsfDisWeaponEvents::WeaponTerminated(), WsfMilEventPipe::WeaponTerminated(), WsfRIPRProcessor::WeaponTerminated(), and WsfUplinkProcessor::WeaponTerminated().
| WsfStringId WsfWeaponEngagement::GetWeaponPlatformName | ( | ) | const |
Return the name (ID) of the weapon platform.
References WsfSimulation::GetPlatformNameId(), and GetSimulation().
Referenced by wsf::event::utils::PrintWE_PlayerData(), and wsf::event::utilsCSV::PrintWE_PlayerData().
| const WsfWeapon * WsfWeaponEngagement::GetWeaponSystem | ( | ) | const |
Access the weapon system to retrieve other information.
References WsfComponentList::GetComponent(), and GetFiringPlatform().
Referenced by WsfHEL_Lethality::ApplyEffectIncrement(), WsfHEL_Lethality::ApplyEffectTo(), WsfHEL_Lethality::CalcInterceptPk(), WsfTowedMover::CleanUpStowedAsset(), WsfWeaponServer::GenerateCommand(), WsfDisWeaponEvents::IsOutgoingWeaponTransfer(), WsfWeaponServer::SendToOtherWeaponServer(), Fires::Observer::WeaponFired(), WsfBallisticMissileLaunchComputer::WeaponFired(), WsfDisWeaponEvents::WeaponFired(), WsfRIPRProcessor::WeaponFired(), WsfWeaponTaskManager::WeaponFired(), and WsfDisWeaponEvents::WeaponTerminated().
|
inline |
Return the name of the firing weapon system (as a string ID).
Referenced by WsfGuidedMoverBase::Initialize2(), wsf::event::utils::PrintWE_PlayerData(), wsf::event::utilsCSV::PrintWE_PlayerData(), WsfRIPRProcessor::StartUplinking(), WsfRIPRProcessor::StartUplinking(), WsfUplinkProcessor::StartUplinking(), WsfDisWeaponEvents::TransferPlatformToInternalControl(), WsfRIPRProcessor::WeaponFired(), WsfWeaponTaskManager::WeaponFired(), wsf::UCI_WeaponComponent::WeaponFiredCB(), WsfRIPRProcessor::WeaponHit(), WsfRIPRProcessor::WeaponMissed(), and WsfRIPRProcessor::WeaponTerminated().
|
inline |
Return the type of the firing weapon system (as a string ID).
| void WsfWeaponEngagement::GetWeaponVelocityAtLaunchWCS | ( | double | aWeaponVelWCS[3] | ) | const |
Get the velocity of the weapon at the time of launch.
| 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). |
| void WsfWeaponEngagement::GetWeaponVelocityECS | ( | double | aWeaponVelECS[3] | ) | const |
| aWeaponVelECS | [output] The velocity of the weapon, relative to its target. Intended for use at time of weapon termination. |
References GetTargetPlatform(), GetWeaponPlatform(), and GetWeaponVelocityWCS().
| void WsfWeaponEngagement::GetWeaponVelocityWCS | ( | double | aWeaponVelWCS[3] | ) | const |
Referenced by GetWeaponVelocityECS(), and WsfDisWeaponEvents::WeaponTerminated().
|
virtual |
Initialize the engagement with the weapon platform.
| aSimTime | The current simulation time. |
| aWeaponPlatformPtr | Pointer to the weapon platform or 0 if the weapon is not a platform. |
References WsfPlatform::GetIndex(), WsfSimulation::GetPlatformByIndex(), GetSimulation(), platformPtr, and success.
Referenced by WsfImplicitWeapon::BeginEngagement(), WsfExtDetonation::Execute(), Initialize(), WsfDisDirectedEnergyFire::Process(), and WsfDisFire::Process().
| bool WsfWeaponEngagement::Initialize | ( | WsfPlatform * | aWeaponPlatformPtr | ) |
An alternative form of Initialize that does not modify the engagement start time.
| aWeaponPlatformPtr | Pointer to the weapon platform or 0 if the weapon is not a platform. |
References Initialize().
|
inline |
Return whether this engagement is complete.
Referenced by WsfImplicitWeapon::TerminateEngagementEvent::Execute().
|
inline |
Is the engagement externally controlled?
Referenced by WsfDisWeaponEvents::DirectedEnergyWeaponFired(), and WsfDisWeaponEvents::WeaponTerminated().
|
protecteddelete |
References WsfWeaponEngagement().
|
inline |
Set the completion time of the engagement.
Referenced by WsfImplicitWeapon::BeginEngagement(), and WsfWeaponFuse::PrivateDetonate().
|
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().
| 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.
References WsfPlatform::GetIndex().
Referenced by WsfExtDetonation::Execute(), and WsfDisFire::Process().
|
inline |
Set to true is IFC is supported.
Referenced by WsfExplicitWeapon::FireP().
| 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().
| 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().
|
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).
| aIsExternallyControlled | 'true' if the engagement is controlled by an external simulation. |
Referenced by WsfExtDetonation::Execute(), WsfDisDirectedEnergyFire::Process(), and WsfDisFire::Process().
|
inline |
Sets the miss distance as provided by the weapon model.
| aMissDistance | Miss distance (meters). |
Referenced by WsfWeaponFuse::PrivateDetonate().
| 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.
| 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().
| 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.
| aWeaponEffectsType | The name of the weapon effects to be used. |
References WsfObjectTypeList< T >::Clone(), and WsfWeaponEffectsTypes::Get().
Referenced by WsfExtDetonation::Execute(), and WsfWeaponEngagement().
| 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.
| 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().
| 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().
|
static |
Return the GeomtryResult enum from a string.
References cDUD, cFAR_AWAY_ABOVE_GROUND, cFAR_AWAY_GROUND_IMPACT, cFAR_AWAY_IN_AIR, cTARGET_IMPACT, cTARGET_PROXIMITY_ABOVE_GROUND, cTARGET_PROXIMITY_AIR_BURST, cTARGET_PROXIMITY_GROUND_IMPACT, and ok.
Referenced by WsfPlatformScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT().
| 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.
| aSimTime | Current simulated time at engagement termination. |
| aGeometryResult | A 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().
|
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().
| aSimTime | Current simulated time for engagement evaluation. |
References WsfWeaponEffects::cKILLED, and Terminate().
Referenced by WsfDisDirectedEnergyFire::Process(), and WsfImplicitWeapon::Update().
|
protected |
If the current target is different than the intended target, update the intended target.
References WsfTrackManager::GetCurrentTarget(), WsfTrackManager::GetCurrentTargetTrackId(), WsfTrack::GetTargetIndex(), WsfTrack::GetTargetName(), WsfPlatform::GetTrackManager(), and GetWeaponPlatform().
Referenced by GetIntendedTargetName(), GetTargetPlatform(), GetTargetPlatformIndex(), and GetTargetTrackId().
|
friend |
References WsfWeaponEngagement().