VR-Engage  2.2
Loading...
Searching...
No Matches
humanJoystickMovementControllerDescriptor.h
Go to the documentation of this file.
1/*******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4*******************************************************************************/
5
6//! \file humanJoystickMovementControllerDescriptor.h
7//! \ingroup vreVrfobjparam
8//! \brief Human joystick movement controller descriptor for VREngage
9//!
10//! This file defines the DtHumanJoystickMovementControllerDescriptor class, which configures
11//! joystick-controlled human movement in VREngage. It provides parameters for mapping joystick
12//! axes to human entity movement controls, enabling realistic humanoid locomotion via joystick input.
13
14#pragma once
15
17#include <vrfobjparam/joyDeviceControllerDescriptor.h>
18
19namespace makVre
20{
21//! \brief Type identifier string for the human joystick movement controller descriptor
22const char DtHumanJoystickMovementControllerDescriptorType[] = "human-joystick-movement-controller-descriptor";
23
24//! \brief Human joystick movement controller descriptor for VREngage
25//!
26//! This class defines a descriptor for the human joystick movement controller component,
27//! which enables human entity movement via joystick input devices. It provides configuration
28//! for mapping joystick axes to character movement controls, such as turning rate and
29//! forward/backward motion, to create realistic humanoid locomotion in VREngage simulations.
30class VREVRFOBJPARAM_DLL DtHumanJoystickMovementControllerDescriptor : public DtJoyDeviceControllerDescriptor
31{
32public:
33 //! \brief Constructor with component name
34 //! \param name The name of this component
35 //! \param parentRegistry Parent registry for reader/writer functionality (optional)
36 //!
37 //! Creates a new human joystick movement controller descriptor with the specified name.
38 DtHumanJoystickMovementControllerDescriptor(const DtString& name, DtReaderWriterRegistry* parentRegistry = NULL);
39
40 //! \brief Constructor with component name as symbol string
41 //! \param name The name of this component as a symbol string
42 //! \param parentRegistry Parent registry for reader/writer functionality (optional)
43 //!
44 //! Creates a new human joystick movement controller descriptor with the specified name.
46 const DtSymbolString& name, DtReaderWriterRegistry* parentRegistry = NULL);
47
48 //! \brief Virtual destructor
49 //!
50 //! Cleans up resources used by the descriptor.
52
53 //! \brief Copy constructor
54 //! \param orig The source descriptor to copy from
55 //! \param parentRegistry Parent registry for reader/writer functionality (optional)
56 //!
57 //! Creates a new human joystick movement controller descriptor as a copy of the provided original.
59 const DtHumanJoystickMovementControllerDescriptor& orig, DtReaderWriterRegistry* parentRegistry = NULL);
60
61 //! \brief Assignment operator
62 //! \param orig The source descriptor to copy from
63 //! \return Reference to this descriptor after assignment
64 //!
65 //! Assigns the contents of the provided descriptor to this one.
67
68 //! \brief Creates a clone of this descriptor
69 //! \param parentRegistry Parent registry for reader/writer functionality (optional)
70 //! \return Pointer to a new descriptor that is a clone of this one
71 //!
72 //! Creates a new human joystick movement controller descriptor as a deep copy of this one.
73 virtual DtComponentDescriptor* clone(DtReaderWriterRegistry* parentRegistry = NULL) const override;
74
75 //! \brief Gets the type identifier for this descriptor
76 //! \return String identifying this descriptor type
77 //!
78 //! Returns a unique type identifier string for this descriptor type.
79 //! Used for creating descriptors from MTL files.
80 virtual DtString type() const override;
81
82 //! \brief Sets the maximum turning rate
83 //! \param rate The maximum turning rate in radians per second
84 //!
85 //! Sets the maximum rate at which the human entity can turn when controlled by a joystick.
86 virtual void setMaxTurningRate(double rate);
87
88 //! \brief Gets the maximum turning rate
89 //! \return The maximum turning rate in radians per second
90 //!
91 //! Returns the maximum rate at which the human entity can turn when controlled by a joystick.
92 virtual double maxTurningRate() const;
93
94 //! \brief Factory function to create a new instance of this descriptor
95 //! \return Pointer to a newly created descriptor
96 //!
97 //! Static factory function used by the descriptor creation system to instantiate
98 //! new instances of this descriptor type.
99 static DtComponentDescriptor* creator();
100
101protected:
102 //! \brief Default constructor (not implemented)
103 //!
104 //! Default constructor is protected and not implemented to prevent
105 //! creation of instances without proper initialization.
107
108protected:
109 //! \name Configuration Parameters
110 //! These parameters are available for setting in the OPD files.
111 //! @{
112
113 //! \brief Maximum turning rate for the human entity
114 //!
115 //! Defines the maximum rate at which the human entity can turn when controlled
116 //! by a joystick. Higher values allow for faster turning, while lower values
117 //! result in more gradual turns.
118 //!
119 //! Default value: 3.14 (approximately PI)
120 //! Units: radians/second
122
123 //! @}
124};
125} // namespace makVre
DtHumanJoystickMovementControllerDescriptor()
Default constructor (not implemented)
DtHumanJoystickMovementControllerDescriptor & operator=(const DtHumanJoystickMovementControllerDescriptor &orig)
Assignment operator.
static DtComponentDescriptor * creator()
Factory function to create a new instance of this descriptor.
virtual void setMaxTurningRate(double rate)
Sets the maximum turning rate.
DtHumanJoystickMovementControllerDescriptor(const DtString &name, DtReaderWriterRegistry *parentRegistry=NULL)
Constructor with component name.
virtual double maxTurningRate() const
Gets the maximum turning rate.
virtual ~DtHumanJoystickMovementControllerDescriptor() override
Virtual destructor.
DtRwReal myMaxTurningRate
Maximum turning rate for the human entity.
Definition humanJoystickMovementControllerDescriptor.h:121
DtHumanJoystickMovementControllerDescriptor(const DtHumanJoystickMovementControllerDescriptor &orig, DtReaderWriterRegistry *parentRegistry=NULL)
Copy constructor.
virtual DtString type() const override
Gets the type identifier for this descriptor.
virtual DtComponentDescriptor * clone(DtReaderWriterRegistry *parentRegistry=NULL) const override
Creates a clone of this descriptor.
DtHumanJoystickMovementControllerDescriptor(const DtSymbolString &name, DtReaderWriterRegistry *parentRegistry=NULL)
Constructor with component name as symbol string.
Export macros for the VREngage Object Parameter library.
#define VREVRFOBJPARAM_DLL
Platform-specific DLL export/import declaration.
Definition export.h:27
Include export definitions for this library.
Definition glsVreMessageUtil.h:49
const char DtHumanJoystickMovementControllerDescriptorType[]
Type identifier string for the human joystick movement controller descriptor.
Definition humanJoystickMovementControllerDescriptor.h:22