VR-Engage  2.3
Loading...
Searching...
No Matches
fixedWingJoyFlightController.h
Go to the documentation of this file.
1/*******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4*******************************************************************************/
5
6//! \file fixedWingJoyFlightController.h
7//! \ingroup vreVrfmodel
8//! \brief Joystick controller for fixed-wing aircraft entities
9//!
10//! This file defines the DtFixedWingJoyFlightController class which extends
11//! the fixed wing pilot controller with joystick control capabilities, allowing
12//! for direct manual control of fixed-wing aircraft.
13
14#pragma once
15
16#include "vreVrfmodel/export.h"
17#include <vrfmodel/fixedWingPilotController.h>
19
20class DtString;
21class DtSimulationServices;
22
23//! \brief Type identifier for the fixed wing joystick flight controller component
24const char DtFixedWingJoyFlightControllerType[] = "fixed-wing-joy-flight-controller";
25
26namespace makVre
27{
28//! \brief Controller for joystick control of fixed wing aircraft
29//!
30//! DtFixedWingJoyFlightController extends the fixed wing pilot controller with
31//! joystick input capabilities, allowing direct manual control of fixed wing aircraft.
32//! It implements the DtVreJoystickControllerInterface to process input from joystick
33//! devices and translate it to appropriate flight control outputs.
34//!
35//! Uses Descriptor Type: DtJoyDeviceControllerDescriptor
36class VREVRFMODEL_DLL DtFixedWingJoyFlightController : public DtFixedWingPilotController,
38{
39public:
40 //! \brief Constructor
41 //! \param name The name of this component
42 //! \param owner The local object that owns this component
43 //! \param simManager The simulation services manager
44 //! \param desc Optional component descriptor
45 //! \param parentRegistry Optional parent registry for reader/writer functionality
46 //!
47 //! Creates a new fixed wing joystick flight controller component with the specified parameters.
48 DtFixedWingJoyFlightController(const DtString& name, DtLocalObject* owner, DtSimulationServices* simManager,
49 DtComponentDescriptor* desc = 0, DtReaderWriterRegistry* parentRegistry = 0);
50
51 //! \brief Virtual destructor
52 //!
53 //! Cleans up resources used by the fixed wing joy flight controller component.
55
56 //! \brief Gets the type identifier for this component
57 //! \return String identifying the component type (DtFixedWingJoyFlightControllerType)
58 //!
59 //! Implements the DtSimComponent::type() method to return the
60 //! type identifier for this component.
61 virtual const char* type() const override;
62
63 //! \brief Calls base first-tick initialization and restores incoming joystick state.
64 virtual void preFirstTickInit() override;
65
66 //! \brief Factory method to create a new instance of this component
67 //! \param name The name for the new component
68 //! \param owner The local object that will own this component
69 //! \param simManager The simulation services manager
70 //! \param desc Optional component descriptor
71 //! \param parentRegistry Optional parent registry for reader/writer functionality
72 //! \return Pointer to the newly created component
73 //!
74 //! Static factory method used by the component creation system to instantiate
75 //! new instances of this component type.
76 static DtSimComponent* creator(const DtString& name, DtLocalObject* owner, DtSimulationServices* simManager,
77 DtComponentDescriptor* desc = 0, DtReaderWriterRegistry* parentRegistry = 0);
78
79private:
80 //! \brief Default constructor (not implemented)
81 //!
82 //! Default constructor is private and not implemented to prevent
83 //! creation of instances without proper initialization.
85
86 //! \brief Copy constructor (not implemented)
87 //!
88 //! Copy constructor is private and not implemented to prevent
89 //! copy construction.
91
92 //! \brief Assignment operator (not implemented)
93 //! \return Reference to this object
94 //!
95 //! Assignment operator is private and not implemented to prevent assignment.
97
98protected:
99 //! \brief Processes joystick input and updates output ports
100 //! \param functionGroup The function group identifier for the input
101 //! \param function The specific function identifier within the group
102 //! \param value The input value from the joystick
103 //! \param repeat Flag indicating if this is a repeated input
104 //!
105 //! Implements the DtJoystickControllerInterface method to process joystick
106 //! input and update the controller's output ports accordingly.
108 const DtString& functionGroup, const DtString& function, double value, bool repeat) override;
109
110 //! \brief Handles joystick connection event
111 //!
112 //! Called when a joystick is connected to the system.
113 //! Activates joystick control mode for this controller.
114 virtual void joystickConnected() override;
115
116 //! \brief Handles joystick disconnection event
117 //!
118 //! Called when a joystick is disconnected from the system.
119 //! Deactivates joystick control mode for this controller.
120 virtual void joystickDisconnected() override;
121};
122} // namespace makVre
DtFixedWingJoyFlightController & operator=(const DtFixedWingJoyFlightController &orig)
Assignment operator (not implemented)
virtual ~DtFixedWingJoyFlightController() override
Virtual destructor.
virtual void calcAndSetPortValues(const DtString &functionGroup, const DtString &function, double value, bool repeat) override
Processes joystick input and updates output ports.
virtual void preFirstTickInit() override
Calls base first-tick initialization and restores incoming joystick state.
DtFixedWingJoyFlightController(const DtFixedWingJoyFlightController &orig)
Copy constructor (not implemented)
virtual void joystickDisconnected() override
Handles joystick disconnection event.
DtFixedWingJoyFlightController(const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
Constructor.
virtual void joystickConnected() override
Handles joystick connection event.
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 const char * type() const override
Gets the type identifier for this component.
DtFixedWingJoyFlightController()
Default constructor (not implemented)
DtVreJoystickControllerInterface(DtSimComponent *component, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc)
Constructs an interface alongside an existing component base.
const char DtFixedWingJoyFlightControllerType[]
Type identifier for the fixed wing joystick flight controller component.
Definition fixedWingJoyFlightController.h:24
Defines export macros for the vreVrfmodel library.
#define VREVRFMODEL_DLL
Definition export.h:22
!
Definition glsVreMessageUtil.h:50
Internal-state persistence for VRE joystick controllers.