VR-Engage  2.2
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 Gets the player control role
148 //! \return String identifying the player role required for control
149 //!
150 //! Returns the role string required for player control of this actuator.
151 virtual DtString playerControlRole() const;
152
153 //! \brief Sets the player control role
154 //! \param role String identifying the player role required for control
155 //!
156 //! Sets the role string required for player control of this actuator.
157 virtual void setPlayerControlRole(DtString role);
158
159 //! \brief Factory function to create a new instance of this descriptor
160 //! \return Pointer to a newly created descriptor
161 //!
162 //! Static factory function used by the descriptor creation system to instantiate
163 //! new instances of this descriptor type.
164 static DtComponentDescriptor* creator();
165
166protected:
167 //! \brief Default constructor (not implemented)
168 //!
169 //! Default constructor is protected and not implemented to prevent
170 //! creation of instances without proper initialization.
172
173protected:
174 //! \name Configuration Parameters
175 //! These parameters are available for setting in the OPD files.
176 //! The values are copied to the PSR so that the articulated part controller
177 //! can access them during simulation.
178 //! @{
179
180 //! \brief The rotation axis controlled by this actuator
181 //!
182 //! Defines which axis of rotation this actuator controls:
183 //! - 0: Azimuth (rotation around vertical axis)
184 //! - 1: Elevation (rotation around horizontal axis)
185 //! - 2: Roll (rotation around longitudinal axis)
186 //!
187 //! Default value: 0
188 DtRwInt myAxis;
189
190 //! \brief Maximum rotation rate for the articulated part
191 //!
192 //! Maximum rate at which the articulated part can rotate.
193 //! Units: radians/second
194 //!
195 //! Default value: 0.0
197
198 //! \brief Flag indicating whether rotation limits are enabled
199 //!
200 //! Indicates whether the articulated part has rotation limits or can rotate freely.
201 //!
202 //! Default value: False
203 DtRwBoolean myHasLimits;
204
205 //! \brief Lower (counter-clockwise) rotation limit
206 //!
207 //! The lower limit (maximum counter-clockwise rotation) of the articulated part.
208 //! Zero is taken to be forward (1, 0, 0), and positive angles go clockwise
209 //! when viewed from above (because the entity z-axis points down).
210 //!
211 //! If the part can rotate 360 degrees, both lower and upper limits should be set to 0.0.
212 //! If the part is fixed, this lower limit is taken to be the fixed position.
213 //!
214 //! Units: radians
215 //! Default value: 0.0
216 DtRwReal myLowerLimit;
217
218 //! \brief Upper (clockwise) rotation limit
219 //!
220 //! The upper limit (maximum clockwise rotation) of the articulated part.
221 //! Zero is taken to be forward, and this parameter is ignored if the part is fixed.
222 //!
223 //! If the part can rotate 360 degrees, both lower and upper limits should be set to 0.0.
224 //!
225 //! Units: radians
226 //! Default value: 0.0
227 DtRwReal myUpperLimit;
228
229 //! \brief Flag to invert slew direction
230 //!
231 //! When set to true, inverts the sense of input relative to slew direction.
232 //!
233 //! Default value: False
234 DtRwBoolean myInvertSlew;
235
236 //! \brief Flag to enable stabilization by default
237 //!
238 //! Defines the initial state of articulated part stabilization.
239 //! When stabilized, the part maintains its orientation in world space
240 //! despite movement of the parent entity.
241 //!
242 //! Default value: False
244
245 //! \brief Player role required for control of this actuator
246 //!
247 //! Specifies the role string required for player control of this actuator.
248 //! This allows for role-based access control to different articulated parts
249 //! on a multi-crew entity.
250 //!
251 //! Default value: "Gunner"
253
254 //! @}
255};
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:196
virtual void setMaxSlewRate(DtReal maxSlewRate)
Sets the maximum slew rate.
virtual ~DtVreStabilizedArtPartActuatorDescriptor() override
Virtual destructor.
DtVreStabilizedArtPartActuatorDescriptor()
Default constructor (not implemented)
DtRwReal myLowerLimit
Lower (counter-clockwise) rotation limit.
Definition artPartActuatorDescriptor.h:216
virtual DtReal upperLimit() const
Gets the upper rotation limit.
DtRwBoolean myHasLimits
Flag indicating whether rotation limits are enabled.
Definition artPartActuatorDescriptor.h:203
DtRwString myPlayerControlRole
Player role required for control of this actuator.
Definition artPartActuatorDescriptor.h:252
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:188
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:243
DtVreStabilizedArtPartActuatorDescriptor & operator=(const DtVreStabilizedArtPartActuatorDescriptor &orig)
Assignment operator.
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.
DtRwBoolean myInvertSlew
Flag to invert slew direction.
Definition artPartActuatorDescriptor.h:234
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:227
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