VR-Engage  2.2
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>
18#include <vrfmodel/joystickControllerInterface.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 DtJoystickControllerInterface 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,
37 public DtJoystickControllerInterface
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 Factory method to create a new instance of this component
64 //! \param name The name for the new component
65 //! \param owner The local object that will own this component
66 //! \param simManager The simulation services manager
67 //! \param desc Optional component descriptor
68 //! \param parentRegistry Optional parent registry for reader/writer functionality
69 //! \return Pointer to the newly created component
70 //!
71 //! Static factory method used by the component creation system to instantiate
72 //! new instances of this component type.
73 static DtSimComponent* creator(const DtString& name, DtLocalObject* owner, DtSimulationServices* simManager,
74 DtComponentDescriptor* desc = 0, DtReaderWriterRegistry* parentRegistry = 0);
75
76private:
77 //! \brief Default constructor (not implemented)
78 //!
79 //! Default constructor is private and not implemented to prevent
80 //! creation of instances without proper initialization.
82
83 //! \brief Copy constructor (not implemented)
84 //!
85 //! Copy constructor is private and not implemented to prevent
86 //! copy construction.
88
89 //! \brief Assignment operator (not implemented)
90 //! \return Reference to this object
91 //!
92 //! Assignment operator is private and not implemented to prevent assignment.
94
95protected:
96 //! \brief Processes joystick input and updates output ports
97 //! \param functionGroup The function group identifier for the input
98 //! \param function The specific function identifier within the group
99 //! \param value The input value from the joystick
100 //! \param repeat Flag indicating if this is a repeated input
101 //!
102 //! Implements the DtJoystickControllerInterface method to process joystick
103 //! input and update the controller's output ports accordingly.
105 const DtString& functionGroup, const DtString& function, double value, bool repeat) override;
106
107 //! \brief Handles joystick connection event
108 //!
109 //! Called when a joystick is connected to the system.
110 //! Activates joystick control mode for this controller.
111 virtual void joystickConnected() override;
112
113 //! \brief Handles joystick disconnection event
114 //!
115 //! Called when a joystick is disconnected from the system.
116 //! Deactivates joystick control mode for this controller.
117 virtual void joystickDisconnected() override;
118};
119} // 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.
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)
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
Include export definitions for this library.
Definition glsVreMessageUtil.h:49