VR-Engage  2.2
Loading...
Searching...
No Matches
vreLauncherActuator.h
Go to the documentation of this file.
1/*******************************************************************************
2** Copyright (c) 2025 MAK Technologies, Inc.
3** All rights reserved.
4*******************************************************************************/
5
6//! \file vreLauncherActuator.h
7//! \ingroup vreVrfmodel
8//! \brief Actuator for missile launcher systems
9//!
10//! This file defines the DtVreLauncherActuator class which extends VR-Forces'
11//! DtLauncherActuator to fire specialized missiles such as the FGM-148 Javelin.
12//! It manages attack mode state and passes it as part of the creation parameters
13//! when creating a missile.
14#pragma once
15
16#include "vreVrfmodel/export.h"
17
18#include <vrfmodel/launcherActuator.h>
19
20
21namespace makVre
22{
23//! \brief Type identifier for the VRE launcher actuator component
24const char DtVreLauncherActuatorType[] = "vre-launcher-actuator";
25
27
28//! \brief Actuator for missile launcher systems with mode-aware functionality
29//!
30//! DtVreLauncherActuator extends the base launcher actuator to provide specialized
31//! missile firing capabilities, particularly for systems like the FGM-148 Javelin.
32//! It maintains the attack mode state of the launcher (e.g., direct attack or
33//! top attack modes) and passes this state as part of the creation parameters
34//! when instantiating a missile. This allows the missile to behave according to
35//! the selected attack mode.
36class VREVRFMODEL_DLL DtVreLauncherActuator : public DtLauncherActuator
37{
38public:
39 //! \brief Constructor
40 //! \param name The name of this component
41 //! \param owner The local object that owns this component
42 //! \param simManager The simulation services manager
43 //! \param desc Component descriptor with configuration parameters
44 //! \param parentRegistry Optional parent registry for reader/writer functionality
45 //!
46 //! Creates a new launcher actuator component with the specified parameters.
47 DtVreLauncherActuator(const DtString& name, DtLocalObject* owner, DtSimulationServices* simManager,
48 DtComponentDescriptor* desc = 0, DtReaderWriterRegistry* parentRegistry = 0);
49
50 //! \brief Virtual destructor
51 //!
52 //! Cleans up resources used by the launcher actuator component.
53 virtual ~DtVreLauncherActuator() override;
54
55 //! \brief Gets the type identifier for this component
56 //! \return String identifying the component type (DtVreLauncherActuatorType)
57 //!
58 //! Implements the DtSimComponent::type() method to return the
59 //! type identifier for this component.
60 virtual const char* type() const override;
61
62 //! \brief Performs initialization before the first simulation tick
63 //!
64 //! Sets the missile attack mode in extended data from the process state repository.
65 //! This ensures that the attack mode is properly initialized before the
66 //! simulation begins, allowing missiles to be created with the correct parameters.
67 virtual void preFirstTickInit() override;
68
69 //! Overridden to add setting <systemName>.current-munition
70 virtual void tick() override;
71
72 //! Called before writing this object out to a file. Gets the current value
73 //! of "attackMode" from extended data and saves it to the process state repository
74 //! before writing it out. This ensures that the attack mode state is properly
75 //! preserved when the scenario is saved.
76 virtual void prePutSelf() override;
77
78 //! @brief Overridden to use the muzzle offset from the descriptor. Base class function isn't working.
79 //! @return muzzle offset in local coordinates.
80 virtual DtVector muzzleLocalPosition() override;
81
82 //! \brief Factory method to create a new instance of this component
83 //! \param name The name for the new component
84 //! \param owner The local object that will own this component
85 //! \param simManager The simulation services manager
86 //! \param desc Optional component descriptor
87 //! \param parentRegistry Optional parent registry for reader/writer functionality
88 //! \return Pointer to the newly created component
89 //!
90 //! Static factory method used by the component creation system to instantiate
91 //! new instances of this component type.
92 static DtSimComponent* creator(const DtString& name, DtLocalObject* owner, DtSimulationServices* simManager,
93 DtComponentDescriptor* desc = 0, DtReaderWriterRegistry* parentRegistry = 0);
94
95protected:
96 //! \brief Creates the process state repository for the actuator
97 //! \return True if PSR creation is successful, false otherwise
98 //!
99 //! Overrides the base class implementation to create and cache a pointer
100 //! to the derived type of process state repository (DtJavelinLauncherPSR).
101 //! This allows direct access to Javelin-specific state information.
102 virtual bool createPSR() override;
103
104 //! \brief Creates a missile object with the appropriate attack mode
105 //! \param createdInfo Information about the object to be created
106 //! \return Handle to the created missile object
107 //!
108 //! Overrides the base class implementation to pass the current attackMode
109 //! extended state parameter as a creation parameter for the missile. This
110 //! allows the missile to be created with the correct attack mode (e.g., direct
111 //! attack or top attack for Javelin missiles).
112 virtual DtCreateObjectHandle createMissile(DtVrfLocalObjectCreateInformation& createdInfo) override;
113
114protected:
115 //! \brief Default constructor (not implemented)
116 //!
117 //! Default constructor is protected and not implemented to prevent
118 //! creation of instances without proper initialization.
120
121 //! \brief Copy constructor (not implemented)
122 //!
123 //! Copy constructor is protected and not implemented to prevent
124 //! copy construction.
126
127 //! \brief Assignment operator (not implemented)
128 //! \return Reference to this object
129 //!
130 //! Assignment operator is protected and not implemented to prevent assignment.
132
133protected:
134 //! \brief Pointer to the Missile launcher process state repository
135 //!
136 //! Stores a typed pointer to the process state repository for more efficient
137 //! access to missile-specific state data such as attack mode. This allows
138 //! the actuator to directly access and modify state without type casting.
140};
141} // namespace makVre
Definition topAndDirectLauncherPSR.h:29
virtual bool createPSR() override
Creates the process state repository for the actuator.
DtVreLauncherActuator(const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
Constructor.
virtual void prePutSelf() override
Called before writing this object out to a file. Gets the current value of "attackMode" from extended...
DtTopAndDirectLauncherPSR * myLauncherPSR
Pointer to the Missile launcher process state repository.
Definition vreLauncherActuator.h:139
static DtSimComponent * creator(const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
Factory method to create a new instance of this component.
DtVreLauncherActuator(const DtVreLauncherActuator &orig)
Copy constructor (not implemented)
virtual DtVector muzzleLocalPosition() override
Overridden to use the muzzle offset from the descriptor. Base class function isn't working.
virtual const char * type() const override
Gets the type identifier for this component.
DtVreLauncherActuator()
Default constructor (not implemented)
virtual void preFirstTickInit() override
Performs initialization before the first simulation tick.
virtual DtCreateObjectHandle createMissile(DtVrfLocalObjectCreateInformation &createdInfo) override
Creates a missile object with the appropriate attack mode.
const DtVreLauncherActuator & operator=(const DtVreLauncherActuator &orig)
Assignment operator (not implemented)
virtual void tick() override
Overridden to add setting <systemName>.current-munition.
virtual ~DtVreLauncherActuator() override
Virtual destructor.
Defines export macros for the vreVrfmodel library.
#define VREVRFMODEL_DLL
Definition export.h:22
Include export definitions for this library.
Definition glsVreMessageUtil.h:49
const char DtVreLauncherActuatorType[]
Type identifier for the VRE launcher actuator component.
Definition vreLauncherActuator.h:24