VR-Engage  2.3
Loading...
Searching...
No Matches
vreRotaryWingActuator.h
Go to the documentation of this file.
1/*******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4*******************************************************************************/
5
6//! \file vreRotaryWingActuator.h
7//! \ingroup vreVrfmodel
8//! \brief Actuator for rotary-wing aircraft simulation
9//!
10//! This file defines the DtVreRotaryWingActuatorComponent class which provides
11//! a kinematics-based model for rotary-wing aircraft. It extends the base actuator
12//! with VR-Engage specific functionality including improved collision detection
13//! and crash handling.
14#pragma once
15
16#include "export.h"
17
18#include <vrfmodel/rotaryWingActuatorComponent.h>
20
21namespace makVre
22{
23//! \brief Type identifier for the VRE rotary wing actuator component
24const char DtVreRotaryWingActuatorType[] = "vre-rotary-wing-actuator";
25
26//! \brief Rotary-wing aircraft actuator with enhanced collision and crash handling
27//!
28//! DtVreRotaryWingActuatorComponent extends the base rotary wing actuator to provide
29//! VR-Engage specific functionality, particularly for collision detection and crash
30//! handling. It includes improved logic for determining landing versus crash states
31//! and configurable options for generating detonation events on crash.
32class VREVRFMODEL_DLL DtVreRotaryWingActuatorComponent : public DtVreSimComponent<DtRotaryWingActuatorComponent>
33{
34public:
35 //! \brief Constructor
36 //! \param name The name of this component
37 //! \param owner The local object that owns this component
38 //! \param simManager The simulation services manager
39 //! \param desc Component descriptor with configuration parameters
40 //! \param parentRegistry Optional parent registry for reader/writer functionality
41 //!
42 //! Creates a new rotary wing actuator component with the specified parameters.
43 DtVreRotaryWingActuatorComponent(const DtString& name, DtLocalObject* owner, DtSimulationServices* simManager,
44 DtComponentDescriptor* desc = 0, DtReaderWriterRegistry* parentRegistry = 0);
45
46 //! \brief Virtual destructor
47 //!
48 //! Cleans up resources used by the rotary wing actuator component,
49 //! removing process state from the process state manager before deleting it.
51
52 //! \brief Gets the type identifier for this component
53 //! \return String identifying the component type (DtVreRotaryWingActuatorType)
54 //!
55 //! Implements the DtSimComponent::type() method to return the
56 //! type identifier for this component.
57 virtual const char* type() const override;
58
59 //! \copydoc DtRotaryWingActuatorComponent::tick()
60 //!
61 //! Refreshes the current pose with zero motion for an already-landed aircraft
62 //! that is nonoperational or out of fuel, while advancing and owning the outputs.
63 virtual void tick() override;
64
65 //! \brief Factory method to create a new instance of this component
66 //! \param name The name for the new component
67 //! \param owner The local object that will own this component
68 //! \param simManager The simulation services manager
69 //! \param desc Optional component descriptor
70 //! \param parentRegistry Optional parent registry for reader/writer functionality
71 //! \return Pointer to the newly created component
72 //!
73 //! Static factory method used by the component creation system to instantiate
74 //! new instances of this component type.
75 static DtSimComponent* creator(const DtString& name, DtLocalObject* owner, DtSimulationServices* simManager,
76 DtComponentDescriptor* desc = 0, DtReaderWriterRegistry* parentRegistry = 0);
77
78protected:
79 //! \brief Sends a detonation event at the crash location if configured
80 //! \param geocentricLocation The geocentric coordinates of the crash location
81 //!
82 //! Checks the component descriptor to determine whether a detonation event
83 //! should be generated when the aircraft crashes. If enabled, creates and
84 //! sends a detonation event at the specified location, which can generate
85 //! visual effects and damage to nearby entities.
86 virtual void sendDetonation(const DtVector& geocentricLocation) override;
87
88 //! \brief Determines if the aircraft has landed or crashed
89 //!
90 //! Overridden to perform the landed check before determining if a crash
91 //! has occurred. This prevents false positives where normal landings are
92 //! incorrectly classified as crashes, fixing an issue with frequent
93 //! crash events occurring during standard landing procedures.
94 virtual void checkLandedOrCrashed() override;
95};
96} // namespace makVre
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.
virtual void checkLandedOrCrashed() override
Determines if the aircraft has landed or crashed.
virtual ~DtVreRotaryWingActuatorComponent() override
Virtual destructor.
DtVreRotaryWingActuatorComponent(const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
Constructor.
virtual const char * type() const override
Gets the type identifier for this component.
virtual void sendDetonation(const DtVector &geocentricLocation) override
Sends a detonation event at the crash location if configured.
DtVreSimComponent(const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
Definition vreSimComponent.h:63
Defines export macros for the vreVrfmodel library.
#define VREVRFMODEL_DLL
Definition export.h:22
!
Definition glsVreMessageUtil.h:50
const char DtVreRotaryWingActuatorType[]
Type identifier for the VRE rotary wing actuator component.
Definition vreRotaryWingActuator.h:24
Base template class for VR-Engage simulation components.