VR-Engage  2.2
Loading...
Searching...
No Matches
vreHumanGunActuatorDescriptor.h
Go to the documentation of this file.
1/*******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4*******************************************************************************/
5
6//! \file vreHumanGunActuatorDescriptor.h
7//! \ingroup vreVrfobjparam
8//! \brief Human gun actuator descriptor for VREngage
9//!
10//! This file defines the DtVreHumanGunActuatorDescriptor class, which configures
11//! human gun actuator components in VREngage. It provides parameters for realistic
12//! human weapon handling, including recoil effects and burst fire behavior.
13
14#pragma once
15
17#include <vrfobjparam/humanGunActuatorDescriptor.h>
18
19
20namespace makVre
21{
22//! \brief Type identifier string for the human gun actuator descriptor
23const char DtVreHumanGunActuatorDescriptorType[] = "vre-human-gun-actuator-descriptor";
24
25//! \brief Human gun actuator descriptor for VREngage
26//!
27//! This class defines a descriptor for human gun actuator components in VREngage.
28//! It extends the base human gun actuator descriptor to add configuration for
29//! realistic human weapon handling, including maximum range, burst fire behavior,
30//! and recoil effects. These parameters affect how human entities interact with
31//! and operate weapons in VREngage simulations.
32class VREVRFOBJPARAM_DLL DtVreHumanGunActuatorDescriptor : public DtHumanGunActuatorDescriptor
33{
34public:
35 //! \brief Constructor with component name
36 //! \param name The name of this component
37 //! \param parentRegistry Parent registry for reader/writer functionality (optional)
38 //!
39 //! Creates a new human gun actuator descriptor with the specified name.
40 DtVreHumanGunActuatorDescriptor(const DtString& name, DtReaderWriterRegistry* parentRegistry = NULL);
41
42 //! \brief Constructor with component name as symbol string
43 //! \param name The name of this component as a symbol string
44 //! \param parentRegistry Parent registry for reader/writer functionality (optional)
45 //!
46 //! Creates a new human gun actuator descriptor with the specified name.
47 DtVreHumanGunActuatorDescriptor(const DtSymbolString& name, DtReaderWriterRegistry* parentRegistry = NULL);
48
49 //! \brief Copy constructor
50 //! \param orig The source descriptor to copy from
51 //! \param parentRegistry Parent registry for reader/writer functionality (optional)
52 //!
53 //! Creates a new human gun actuator descriptor as a copy of the provided original.
55 const DtVreHumanGunActuatorDescriptor& orig, DtReaderWriterRegistry* parentRegistry = NULL);
56
57 //! \brief Assignment operator
58 //! \param orig The source descriptor to copy from
59 //! \return Reference to this descriptor after assignment
60 //!
61 //! Assigns the contents of the provided descriptor to this one.
63
64 //! \brief Virtual destructor
65 //!
66 //! Cleans up resources used by the descriptor.
68
69 //! \brief Gets the type identifier for this descriptor
70 //! \return String identifying this descriptor type
71 //!
72 //! Returns a unique type identifier string for this descriptor type.
73 //! Will return DtVreHumanGunActuatorDescriptorType.
74 virtual DtString type() const override;
75
76 //! \brief Creates a clone of this descriptor
77 //! \param parentRegistry Parent registry for reader/writer functionality (optional)
78 //! \return Pointer to a new descriptor that is a clone of this one
79 //!
80 //! Creates a new human gun actuator descriptor as a deep copy of this one.
81 virtual DtComponentDescriptor* clone(DtReaderWriterRegistry* parentRegistry = NULL) const override;
82
83 //! \brief Gets the maximum range of the weapon
84 //! \return The maximum range in meters
85 //!
86 //! Returns the maximum possible range of the weapon, beyond which projectiles
87 //! cannot travel. This limits the length of the chord used in intersection tests
88 //! for determining targets.
89 virtual DtReal maxRange() const;
90
91 //! \brief Sets the maximum range of the weapon
92 //! \param maxRange The maximum range in meters
93 //!
94 //! Sets the maximum possible range of the weapon, beyond which projectiles
95 //! cannot travel. This limits the length of the chord used in intersection tests
96 //! for determining targets.
97 virtual void setMaxRange(DtReal maxRange);
98
99 //! \brief Gets the number of rounds per trigger pull
100 //! \return The number of bullets fired per trigger pull
101 //!
102 //! Returns the number of bullets fired per trigger pull for burst fire mode.
103 virtual DtInt16 burstPerTrigger() const;
104
105 //! \brief Sets the number of rounds per trigger pull
106 //! \param rounds The number of bullets fired per trigger pull
107 //!
108 //! Sets the number of bullets fired per trigger pull for burst fire mode.
109 virtual void setBurstPerTrigger(DtInt16 rounds);
110
111 //! \brief Gets the recoil offset vector
112 //! \return Reference to the recoil offset vector
113 //!
114 //! Returns the offset vector that controls weapon orientation changes
115 //! during rapid fire (burst) mode, simulating recoil effects.
116 virtual const DtVector& recoilOffset() const;
117
118 //! \brief Sets the recoil offset vector
119 //! \param muzzleOffset The recoil offset vector
120 //!
121 //! Sets the offset vector that controls weapon orientation changes
122 //! during rapid fire (burst) mode, simulating recoil effects.
123 virtual void setRecoilOffset(const DtVector& muzzleOffset);
124
125 //! \brief Checks if recoil offset is specified
126 //! \return True if recoil offset is specified, false otherwise
127 //!
128 //! Returns whether a custom recoil offset has been specified for this weapon.
129 virtual bool isRecoilOffsetSpecified() const;
130
131 //! \brief Factory function to create a new instance of this descriptor
132 //! \return Pointer to a newly created descriptor
133 //!
134 //! Static factory function used by the descriptor creation system to instantiate
135 //! new instances of this descriptor type.
136 static DtComponentDescriptor* creator();
137
138protected:
139 //! \brief Default constructor (not implemented)
140 //!
141 //! Default constructor is protected and not implemented to prevent
142 //! creation of instances without proper initialization.
144
145protected:
146 //! \brief Maximum range of the weapon in meters
147 //!
148 //! The maximum possible range of the weapon, beyond which projectiles
149 //! cannot travel. This limits the length of the chord used in intersection
150 //! tests for determining targets.
151 //! Parameter name: "max-range"
152 //! Default value: 500.0 meters
153 DtRwReal myMaxRange;
154
155 //! \brief Number of bullets fired per trigger pull
156 //!
157 //! Defines the number of bullets fired in sequence when the trigger is pulled once.
158 //! Used for burst fire mode configuration.
159 //! Parameter name: "rounds-per-trigger"
160 //! Default value: 1 (single shot)
161 //! Units: Bullets
163
164 //! \brief Recoil offset vector for weapon orientation during rapid fire
165 //!
166 //! This vector defines how the weapon orientation changes during rapid fire (burst) mode,
167 //! simulating recoil effects. In a body coordinate system, the axes are specified as follows:
168 //! - x: limits of the randomized change in weapon 'heading' (yaw)
169 //! - y: limits of the randomized change in weapon 'pitch'
170 //! - z: unused
171 //!
172 //! Parameter name: "recoil-offset"
173 //! Default value: 0.0
174 //! Units: Degrees
175 DtRwOffsetVector myRecoilOffset;
176};
177} // namespace makVre
virtual DtReal maxRange() const
Gets the maximum range of the weapon.
DtVreHumanGunActuatorDescriptor()
Default constructor (not implemented)
virtual ~DtVreHumanGunActuatorDescriptor() override
Virtual destructor.
static DtComponentDescriptor * creator()
Factory function to create a new instance of this descriptor.
virtual void setRecoilOffset(const DtVector &muzzleOffset)
Sets the recoil offset vector.
virtual DtComponentDescriptor * clone(DtReaderWriterRegistry *parentRegistry=NULL) const override
Creates a clone of this descriptor.
virtual const DtVector & recoilOffset() const
Gets the recoil offset vector.
virtual DtInt16 burstPerTrigger() const
Gets the number of rounds per trigger pull.
DtRwInt myBurstPerTrigger
Number of bullets fired per trigger pull.
Definition vreHumanGunActuatorDescriptor.h:162
DtVreHumanGunActuatorDescriptor(const DtVreHumanGunActuatorDescriptor &orig, DtReaderWriterRegistry *parentRegistry=NULL)
Copy constructor.
DtVreHumanGunActuatorDescriptor(const DtSymbolString &name, DtReaderWriterRegistry *parentRegistry=NULL)
Constructor with component name as symbol string.
virtual void setMaxRange(DtReal maxRange)
Sets the maximum range of the weapon.
DtRwOffsetVector myRecoilOffset
Recoil offset vector for weapon orientation during rapid fire.
Definition vreHumanGunActuatorDescriptor.h:175
DtVreHumanGunActuatorDescriptor & operator=(const DtVreHumanGunActuatorDescriptor &orig)
Assignment operator.
DtRwReal myMaxRange
Maximum range of the weapon in meters.
Definition vreHumanGunActuatorDescriptor.h:153
virtual DtString type() const override
Gets the type identifier for this descriptor.
virtual bool isRecoilOffsetSpecified() const
Checks if recoil offset is specified.
DtVreHumanGunActuatorDescriptor(const DtString &name, DtReaderWriterRegistry *parentRegistry=NULL)
Constructor with component name.
virtual void setBurstPerTrigger(DtInt16 rounds)
Sets the number of rounds per trigger pull.
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 DtVreHumanGunActuatorDescriptorType[]
Type identifier string for the human gun actuator descriptor.
Definition vreHumanGunActuatorDescriptor.h:23