VR-Engage  2.2
Loading...
Searching...
No Matches
vreParachuteActuator.h
Go to the documentation of this file.
1/*******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4*******************************************************************************/
5
6//! \file vreParachuteActuator.h
7//! \ingroup vreVrfmodel
8//! \brief Actuator for parachute simulation
9//!
10//! This file defines the DtVreParachuteActuator class which provides
11//! functionality for simulating parachute behavior including stowed and
12//! deployed states, forward movement, steering, and oxygen usage.
13#pragma once
14
15#include "vreVrfmodel/export.h"
17
18#include <vrfmodel/parachuteActuator.h>
19
20// #include <matrix/LibMatrix.h>
21// #include <vlpi/disEnums.h>
22// //
23// class DtString;
24// class DtSimulationServices;
25// class DtVrfMovingObjectStateRepository;
26// class DtConstrainedAnalogInputPort;
27// class DtAnalogInputPort;
28// class DtBooleanInputPort;
29// class DtInputPortGroup;
30// class DtVectorInputPort;
31// class DtAnalogOutputPort;
32// class DtBooleanOutputPort;
33
34namespace makVre
35{
37// class DtParachuteActuatorPSR;
38
39// NOTE-RCH-This is in VRF
40//! \brief Type identifier for the VRE parachute actuator component
41const char DtVreParachuteActuatorType[] = "vre-parachute-actuator";
42
43//! \brief Actuator for simulating parachute behavior in various states
44//!
45//! DtVreParachuteActuator extends the base parachute actuator to provide
46//! VR-Engage specific functionality. It supports both stowed and deployed states,
47//! forward movement, steering control, and simulates oxygen consumption at high
48//! altitudes or in vehicles with open cargo doors. The actuator manages the
49//! physics of parachute deployment and descent.
50//!
51//! Uses Descriptor Type: DtVreParachuteActuatorDescriptor
52class VREVRFMODEL_DLL DtVreParachuteActuator : public DtVreSimComponent<DtParachuteActuator>
53{
54public:
55 //! \brief Constructor
56 //! \param name The name of this component
57 //! \param owner The local object that owns this component
58 //! \param simManager The simulation services manager
59 //! \param desc Component descriptor with configuration parameters
60 //! \param parentRegistry Optional parent registry for reader/writer functionality
61 //!
62 //! Creates a new parachute actuator component with the specified parameters.
63 DtVreParachuteActuator(const DtString& name, DtLocalObject* owner, DtSimulationServices* simManager,
64 DtComponentDescriptor* desc = 0, DtReaderWriterRegistry* parentRegistry = 0);
65
66 //! \brief Virtual destructor
67 //!
68 //! Cleans up resources used by the parachute actuator component,
69 //! removing process state from process state manager before deleting it.
70 virtual ~DtVreParachuteActuator() override;
71
72 //! to get access to the entity's localStateRepository, which this component
73 //! will update, and then connect to the controller's ports.
74 // virtual bool init();
75
76 //! \brief Gets the type identifier for this component
77 //! \return String identifying the component type (DtVreParachuteActuatorType)
78 //!
79 //! Implements the DtSimComponent::type() method to return the
80 //! type identifier for this component.
81 virtual const char* type() const override;
82
83 //! \brief Updates the actuator state each simulation frame
84 //!
85 //! Processes parachute simulation logic each simulation frame, updating
86 //! position, orientation, and velocity based on the parachute state (stowed
87 //! or deployed). Also handles oxygen usage and updates any hand items.
88 virtual void tick() override;
89
90 //! \brief Factory method to create a new instance of this component
91 //! \param name The name for the new component
92 //! \param owner The local object that will own this component
93 //! \param simManager The simulation services manager
94 //! \param desc Optional component descriptor
95 //! \param parentRegistry Optional parent registry for reader/writer functionality
96 //! \return Pointer to the newly created component
97 //!
98 //! Static factory method used by the component creation system to instantiate
99 //! new instances of this component type.
100 static DtSimComponent* creator(const DtString& name, DtLocalObject* owner, DtSimulationServices* simManager,
101 DtComponentDescriptor* desc = 0, DtReaderWriterRegistry* parentRegistry = 0);
102
103protected:
104 //! \brief Simulates oxygen consumption in high-altitude conditions
105 //!
106 //! Simulates the use of oxygen when the entity is above a certain altitude
107 //! and falling, or when inside a vehicle with an open cargo door. This affects
108 //! the remaining oxygen supply for the entity, which can impact behavior when
109 //! oxygen is depleted.
110 virtual void useOxygen();
111
112 //! \brief Checks if the cargo door on a specified entity is open
113 //! \param entity Reference to the entity to check
114 //! \return True if the cargo door is open, false otherwise
115 //!
116 //! Determines whether the cargo door on the specified entity is in the open
117 //! position. This affects oxygen usage when the entity is inside a vehicle.
118 virtual bool isCargoDoorOpen(DtSimObjectReference entity) const;
119
120 //! \brief Determines if falling behavior should be applied
121 //! \param dataAvailable Output parameter indicating if required data is available
122 //! \return True if falling behavior should be applied, false otherwise
123 //!
124 //! Checks various conditions to determine whether falling behavior should
125 //! be applied to the entity in the current state. Sets the dataAvailable
126 //! parameter to indicate if all required data was available for the check.
127 virtual bool checkFallingApplicable(bool& dataAvailable) override;
128
129 //! \brief Calculates new orientation based on rotation rates
130 //! \param oldLocalOrientation The current orientation matrix
131 //! \param newBodyRotationRates The rotation rates in body coordinates
132 //! \param newLocalOrientation Output parameter for the new orientation matrix
133 //!
134 //! Calculates a new orientation matrix based on the previous orientation and
135 //! the specified rotation rates. The calculation takes into account the dynamics
136 //! of parachute movement and steering inputs.
138 const DtDcm& oldLocalOrientation, const DtVector& newBodyRotationRates, DtDcm& newLocalOrientation) override;
139
140 //! \brief Updates the entity's hand item based on parachute state
141 //!
142 //! Updates the item in the entity's hands based on the current state of the
143 //! parachute (stowed or deployed). This ensures that the entity is visually
144 //! represented with the appropriate items during parachute operation.
145 virtual void updateHandItem() override;
146
147private:
148 //! \brief Default constructor (not implemented)
149 //!
150 //! Default constructor is private and not implemented to prevent
151 //! creation of instances without proper initialization.
153
154 //! \brief Copy constructor (not implemented)
155 //!
156 //! Copy constructor is private and not implemented to prevent
157 //! copy construction.
159
160 //! \brief Assignment operator (not implemented)
161 //! \return Reference to this object
162 //!
163 //! Assignment operator is private and not implemented to prevent assignment.
165
166protected:
167 //! \brief Pointer to the parachute actuator descriptor
168 //!
169 //! Contains configuration parameters for the parachute actuator,
170 //! such as deployment altitude, descent rate, and steering sensitivity.
172
173 //! \brief Name of the property representing the entity's oxygen state
174 //!
175 //! This constant string holds the property name used to access or update
176 //! the oxygen state of the entity within the simulation.
177 const std::string myOxygenStatePropertyName = "Oxygen";
178
179 //! \brief Last known height of the ground/floor beneath the entity
180 //!
181 //! Tracks the last known height of the ground or floor beneath the entity,
182 //! used for determining landing conditions and altitude-related behaviors.
184};
185
186} // namespace makVre
Parachute actuator descriptor for VREngage.
Definition vreParachuteActuatorDescriptor.h:33
DtVreParachuteActuator()
Default constructor (not implemented)
const std::string myOxygenStatePropertyName
Name of the property representing the entity's oxygen state.
Definition vreParachuteActuator.h:177
double myLastKnownFloorHeight
Last known height of the ground/floor beneath the entity.
Definition vreParachuteActuator.h:183
DtVreParachuteActuator(const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
Constructor.
virtual bool checkFallingApplicable(bool &dataAvailable) override
Determines if falling behavior should be applied.
virtual void tick() override
Updates the actuator state each simulation frame.
virtual const char * type() const override
to get access to the entity's localStateRepository, which this component will update,...
virtual void calculateOrientation(const DtDcm &oldLocalOrientation, const DtVector &newBodyRotationRates, DtDcm &newLocalOrientation) override
Calculates new orientation based on rotation rates.
DtVreParachuteActuatorDescriptor * myDescriptor
Pointer to the parachute actuator descriptor.
Definition vreParachuteActuator.h:171
virtual void useOxygen()
Simulates oxygen consumption in high-altitude conditions.
virtual bool isCargoDoorOpen(DtSimObjectReference entity) const
Checks if the cargo door on a specified entity is open.
DtVreParachuteActuator(const DtVreParachuteActuator &orig)
Copy constructor (not implemented)
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.
const DtVreParachuteActuator & operator=(const DtVreParachuteActuator &orig)
Assignment operator (not implemented)
virtual void updateHandItem() override
Updates the entity's hand item based on parachute state.
virtual ~DtVreParachuteActuator() override
Virtual destructor.
DtVreSimComponent(const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
Definition vreSimComponent.h:54
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 DtVreParachuteActuatorType[]
Type identifier for the VRE parachute actuator component.
Definition vreParachuteActuator.h:41
Base template class for VR-Engage simulation components.