VR-Engage  2.3
Loading...
Searching...
No Matches
artPartActuatorDescriptor.h
Go to the documentation of this file.
1/*******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4*******************************************************************************/
5
6//! \file artPartActuatorDescriptor.h
7//! \ingroup vreVrfobjparam
8//! \brief Stabilized articulated part actuator descriptor for VREngage
9//!
10//! This file defines the DtVreStabilizedArtPartActuatorDescriptor class, which provides
11//! configuration parameters for stabilized articulated parts in VREngage. This includes
12//! parameters for rotation limits, slew rates, stabilization settings, and player control.
13
14#pragma once
15
17
18#include <vrfobjparam/actuatorComponentDescriptor.h>
19#include <readerWriter/rwReal.h>
20#include <readerWriter/rwInt.h>
21
22class DtReaderWriterRegistry;
23
24//! \brief Type identifier string for the stabilized articulated part actuator descriptor
25const char DtVreStabilizedArtPartActuatorDescriptorType[] = "vre-stabilized-art-part-actuator-descriptor";
26
27//! \brief Stabilized articulated part actuator descriptor for VREngage
28//!
29//! This class extends the base actuator component descriptor with additional parameters
30//! specific to stabilized articulated parts in VREngage. It provides configuration
31//! for rotation limits, slew rates, stabilization settings, and player control roles.
32
33//! \brief Stabilized articulated part actuator descriptor for VREngage
34//!
35//! This class extends the base actuator component descriptor with additional parameters
36//! specific to stabilized articulated parts in VREngage. It provides configuration
37//! for rotation limits, slew rates, stabilization settings, and player control roles.
38class VREVRFOBJPARAM_DLL DtVreStabilizedArtPartActuatorDescriptor : public DtActuatorComponentDescriptor
39{
40public:
41 //! \brief Constructor with component name
42 //! \param componentName The name of this component
43 //! \param parentRegistry Parent registry for reader/writer functionality (optional)
44 //!
45 //! Creates a new stabilized articulated part actuator descriptor with the specified name.
46 DtVreStabilizedArtPartActuatorDescriptor(const DtString& componentName, DtReaderWriterRegistry* parentRegistry = 0);
47
48 //! \brief Copy constructor
49 //! \param orig The source descriptor to copy from
50 //! \param parentRegistry Parent registry for reader/writer functionality (optional)
51 //!
52 //! Creates a new stabilized articulated part actuator descriptor as a copy of the provided original.
54 const DtVreStabilizedArtPartActuatorDescriptor& orig, DtReaderWriterRegistry* parentRegistry = 0);
55
56 //! \brief Assignment operator
57 //! \param orig The source descriptor to copy from
58 //! \return Reference to this descriptor after assignment
59 //!
60 //! Assigns the contents of the provided descriptor to this one.
62
63 //! \brief Virtual destructor
64 //!
65 //! Cleans up resources used by the descriptor.
67
68 //! \brief Gets the type identifier for this descriptor
69 //! \return String identifying this descriptor type
70 //!
71 //! Returns a unique type identifier string for this descriptor type.
72 virtual DtString type() const override;
73
74 //! \brief Creates a clone of this descriptor
75 //! \param parentRegistry Parent registry for reader/writer functionality (optional)
76 //! \return Pointer to a new descriptor that is a clone of this one
77 //!
78 //! Creates a new stabilized articulated part actuator descriptor as a deep copy of this one.
79 virtual DtComponentDescriptor* clone(DtReaderWriterRegistry* parentRegistry = 0) const override;
80
81 //! \brief Gets the rotation axis for this actuator
82 //! \return The axis index (0 for azimuth, 1 for elevation, 2 for roll)
83 //!
84 //! Returns the axis of rotation that this actuator controls.
85 virtual DtU16 axis() const;
86
87 //! \brief Gets the maximum slew rate
88 //! \return The maximum slew rate in radians per second
89 //!
90 //! Returns the maximum rate at which the articulated part can rotate.
91 virtual DtReal maxSlewRate() const;
92
93 //! \brief Sets the maximum slew rate
94 //! \param maxSlewRate The maximum slew rate in radians per second
95 //!
96 //! Sets the maximum rate at which the articulated part can rotate.
97 virtual void setMaxSlewRate(DtReal maxSlewRate);
98
99 //! \brief Checks if the actuator has rotation limits
100 //! \return True if the actuator has rotation limits, false otherwise
101 //!
102 //! Returns whether the articulated part has limited rotation or can rotate freely.
103 virtual bool hasLimits() const;
104
105 //! \brief Sets whether the actuator has rotation limits
106 //! \param hasLimits True to enable rotation limits, false for free rotation
107 //!
108 //! Sets whether the articulated part has limited rotation or can rotate freely.
109 virtual void setHasLimits(bool hasLimits);
110
111 //! \brief Gets the upper rotation limit
112 //! \return The upper (clockwise) rotation limit in radians
113 //!
114 //! Returns the maximum clockwise rotation limit for this articulated part.
115 virtual DtReal upperLimit() const;
116
117 //! \brief Gets the lower rotation limit
118 //! \return The lower (counter-clockwise) rotation limit in radians
119 //!
120 //! Returns the maximum counter-clockwise rotation limit for this articulated part.
121 virtual DtReal lowerLimit() const;
122
123 //! \brief Checks if slew direction is inverted
124 //! \return True if slew direction is inverted, false otherwise
125 //!
126 //! Returns whether the sense of input relative to slew direction is inverted.
127 virtual bool invertSlew() const;
128
129 //! \brief Sets whether slew direction is inverted
130 //! \param invert True to invert slew direction, false otherwise
131 //!
132 //! Sets whether the sense of input relative to slew direction is inverted.
133 virtual void setInvertSlew(bool invert);
134
135 //! \brief Checks if stabilization is enabled by default
136 //! \return True if stabilization is enabled by default, false otherwise
137 //!
138 //! Returns whether the articulated part is stabilized when initialized.
139 virtual bool stabilizedByDefault() const;
140
141 //! \brief Sets whether stabilization is enabled by default
142 //! \param onOff True to enable stabilization by default, false otherwise
143 //!
144 //! Sets whether the articulated part is stabilized when initialized.
145 virtual void setStabilizedByDefault(bool onOff);
146
147 //! @brief Indicates whether this actuator manages the stabilization/override
148 //! vector for the system.
149 virtual bool amCueMaster() const;
150
151 //! \brief Sets whether this actuator manages the stabilization/override
152 //! vector for the system.
153 virtual void setAmCueMaster(bool maybe);
154
155 //! \brief Gets the player control role
156 //! \return String identifying the player role required for control
157 //!
158 //! Returns the role string required for player control of this actuator.
159 virtual DtString playerControlRole() const;
160
161 //! \brief Sets the player control role
162 //! \param role String identifying the player role required for control
163 //!
164 //! Sets the role string required for player control of this actuator.
165 virtual void setPlayerControlRole(DtString role);
166
167 //! \brief Factory function to create a new instance of this descriptor
168 //! \return Pointer to a newly created descriptor
169 //!
170 //! Static factory function used by the descriptor creation system to instantiate
171 //! new instances of this descriptor type.
172 static DtComponentDescriptor* creator();
173
174protected:
175 //! \brief Default constructor (not implemented)
176 //!
177 //! Default constructor is protected and not implemented to prevent
178 //! creation of instances without proper initialization.
180
181protected:
182 //! \name Configuration Parameters
183 //! These parameters are available for setting in the OPD files.
184 //! The values are copied to the PSR so that the articulated part controller
185 //! can access them during simulation.
186 //! @{
187
188 //! \brief The rotation axis controlled by this actuator
189 //!
190 //! Defines which axis of rotation this actuator controls:
191 //! - 0: Azimuth (rotation around vertical axis)
192 //! - 1: Elevation (rotation around horizontal axis)
193 //! - 2: Roll (rotation around longitudinal axis)
194 //!
195 //! Default value: 0
196 DtRwInt myAxis;
197
198 //! \brief Maximum rotation rate for the articulated part
199 //!
200 //! Maximum rate at which the articulated part can rotate.
201 //! Units: radians/second
202 //!
203 //! Default value: 0.0
205
206 //! \brief Flag indicating whether rotation limits are enabled
207 //!
208 //! Indicates whether the articulated part has rotation limits or can rotate freely.
209 //!
210 //! Default value: False
211 DtRwBoolean myHasLimits;
212
213 //! \brief Lower (counter-clockwise) rotation limit
214 //!
215 //! The lower limit (maximum counter-clockwise rotation) of the articulated part.
216 //! Zero is taken to be forward (1, 0, 0), and positive angles go clockwise
217 //! when viewed from above (because the entity z-axis points down).
218 //!
219 //! If the part can rotate 360 degrees, both lower and upper limits should be set to 0.0.
220 //! If the part is fixed, this lower limit is taken to be the fixed position.
221 //!
222 //! Units: radians
223 //! Default value: 0.0
224 DtRwReal myLowerLimit;
225
226 //! \brief Upper (clockwise) rotation limit
227 //!
228 //! The upper limit (maximum clockwise rotation) of the articulated part.
229 //! Zero is taken to be forward, and this parameter is ignored if the part is fixed.
230 //!
231 //! If the part can rotate 360 degrees, both lower and upper limits should be set to 0.0.
232 //!
233 //! Units: radians
234 //! Default value: 0.0
235 DtRwReal myUpperLimit;
236
237 //! \brief Flag to invert slew direction
238 //!
239 //! When set to true, inverts the sense of input relative to slew direction.
240 //!
241 //! Default value: False
242 DtRwBoolean myInvertSlew;
243
244 //! \brief Flag to enable stabilization by default
245 //!
246 //! Defines the initial state of articulated part stabilization.
247 //! When stabilized, the part maintains its orientation in world space
248 //! despite movement of the parent entity.
249 //!
250 //! Default value: False
252
253 //! @brief Indicates whether this actuator manages the stabilization/override
254 //! vector for the system.
255 //!
256 //! On a stabilized system with multiple parts, only the part at the end of the
257 //! kinematic chain should manage the stabilization cue vector. e.g. the gun
258 //! part mounted on a turret.
259 //!
260 //! Default value: False
261 DtRwBoolean myAmCueMaster;
262
263 //! \brief Player role required for control of this actuator
264 //!
265 //! Specifies the role string required for player control of this actuator.
266 //! This allows for role-based access control to different articulated parts
267 //! on a multi-crew entity.
268 //!
269 //! Default value: "Gunner"
271
272 //! @}
273};
const char DtVreStabilizedArtPartActuatorDescriptorType[]
Type identifier string for the stabilized articulated part actuator descriptor.
Definition artPartActuatorDescriptor.h:25
virtual void setInvertSlew(bool invert)
Sets whether slew direction is inverted.
DtVreStabilizedArtPartActuatorDescriptor(const DtString &componentName, DtReaderWriterRegistry *parentRegistry=0)
Constructor with component name.
virtual void setPlayerControlRole(DtString role)
Sets the player control role.
DtRwReal myMaxSlewRate
Maximum rotation rate for the articulated part.
Definition artPartActuatorDescriptor.h:204
virtual void setMaxSlewRate(DtReal maxSlewRate)
Sets the maximum slew rate.
DtRwBoolean myAmCueMaster
Indicates whether this actuator manages the stabilization/override vector for the system.
Definition artPartActuatorDescriptor.h:261
virtual ~DtVreStabilizedArtPartActuatorDescriptor() override
Virtual destructor.
DtVreStabilizedArtPartActuatorDescriptor()
Default constructor (not implemented)
DtRwReal myLowerLimit
Lower (counter-clockwise) rotation limit.
Definition artPartActuatorDescriptor.h:224
virtual DtReal upperLimit() const
Gets the upper rotation limit.
DtRwBoolean myHasLimits
Flag indicating whether rotation limits are enabled.
Definition artPartActuatorDescriptor.h:211
DtRwString myPlayerControlRole
Player role required for control of this actuator.
Definition artPartActuatorDescriptor.h:270
virtual DtString playerControlRole() const
Gets the player control role.
virtual void setHasLimits(bool hasLimits)
Sets whether the actuator has rotation limits.
static DtComponentDescriptor * creator()
Factory function to create a new instance of this descriptor.
virtual DtString type() const override
Gets the type identifier for this descriptor.
DtRwInt myAxis
The rotation axis controlled by this actuator.
Definition artPartActuatorDescriptor.h:196
virtual bool hasLimits() const
Checks if the actuator has rotation limits.
DtVreStabilizedArtPartActuatorDescriptor(const DtVreStabilizedArtPartActuatorDescriptor &orig, DtReaderWriterRegistry *parentRegistry=0)
Copy constructor.
DtRwBoolean myStabilizedByDefault
Flag to enable stabilization by default.
Definition artPartActuatorDescriptor.h:251
DtVreStabilizedArtPartActuatorDescriptor & operator=(const DtVreStabilizedArtPartActuatorDescriptor &orig)
Assignment operator.
virtual bool amCueMaster() const
Indicates whether this actuator manages the stabilization/override vector for the system.
virtual DtReal maxSlewRate() const
Gets the maximum slew rate.
virtual bool stabilizedByDefault() const
Checks if stabilization is enabled by default.
virtual DtU16 axis() const
Gets the rotation axis for this actuator.
virtual void setAmCueMaster(bool maybe)
Sets whether this actuator manages the stabilization/override vector for the system.
DtRwBoolean myInvertSlew
Flag to invert slew direction.
Definition artPartActuatorDescriptor.h:242
virtual DtReal lowerLimit() const
Gets the lower rotation limit.
virtual bool invertSlew() const
Checks if slew direction is inverted.
virtual void setStabilizedByDefault(bool onOff)
Sets whether stabilization is enabled by default.
DtRwReal myUpperLimit
Upper (clockwise) rotation limit.
Definition artPartActuatorDescriptor.h:235
virtual DtComponentDescriptor * clone(DtReaderWriterRegistry *parentRegistry=0) const override
Creates a clone of this descriptor.
Export macros for the VREngage Object Parameter library.
#define VREVRFOBJPARAM_DLL
Platform-specific DLL export/import declaration.
Definition export.h:27