VR-Engage  2.3
Loading...
Searching...
No Matches
humanWeaponPoseLogic.h
Go to the documentation of this file.
1/******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4******************************************************************************/
5
6//! \file humanWeaponPoseLogic.h
7//! \brief Defines DtHumanWeaponPoseLogic for managing human weapon positioning and orientation
8//! \ingroup vreHumanFrontend
9
10#pragma once
11
13
15
17
18namespace makVrv
19{
20//! \brief Forward declaration of the display element class
21class DtDe;
22
23//! \brief Forward declaration of the observer class
24class DtObserver;
25} // namespace makVrv
26
27//! \brief Type identifier constant for DtHumanWeaponPoseLogic components
28//!
29//! This constant defines the string identifier used to identify DtHumanWeaponPoseLogic
30//! component types within the VR-Engage framework. It is used for component
31//! registration, type checking, and serialization operations.
32constexpr const char* DtHumanWeaponPoseLogicType = "DtHumanWeaponPoseLogic";
33
34//! \brief Weapon pose logic component for the human role
35//!
36//! DtHumanWeaponPoseLogic manages the positioning and orientation of weapons
37//! for the human entity, handling weapon alignment with observer view and
38//! adjustments for different postures and aiming states. This component ensures
39//! weapons appear correctly positioned relative to the player's view.
41{
42public:
43 //! \brief Default constructor
45
46 //! \brief Virtual destructor
47 virtual ~DtHumanWeaponPoseLogic() override;
48
49 //! \brief Initializes the weapon pose logic component
50 //! \param player Pointer to the player station
51 //! \param config Configuration settings for initialization
52 //! \return True if initialization was successful, false otherwise
54
55 //! \brief Updates weapon positioning for the current frame
56 //! \param dt Delta time since the last frame in seconds
57 virtual void tick(double dt) override;
58
59 //! \brief Cleans up resources when the component is being shut down
60 virtual void shutdown() override;
61
62 //! \brief Returns the component type identifier
63 //! \return String identifier for this component type
64 //!
65 //! Returns the type identifier string for this component, which is used
66 //! by the VR-Engage framework for component identification and management.
67 //! The returned value matches DtHumanWeaponPoseLogicType.
68 virtual const char* type() const override;
69
70protected:
71 //! \brief Updates the weapon position and orientation
72 //!
73 //! Calculates and applies the appropriate weapon position based on the current
74 //! player state, view orientation, and VR mode settings
76
77 //! \brief Pointer to the observer used for view orientation
78 makVrv::DtObserver* myObserver;
79
80 //! \brief Flag indicating if VR mode is active
82
83 //! \brief Handle for VR-enabled state.
84 //! \vreAttrKey{vr-enabled}
86
87 //! \brief Handle for current equipment.
88 //! \vreAttrKey{currentEquipment}
90
91 //! \brief Handle for computed weapon location.
92 //! \vreAttrKey{weaponLocation}
94
95 //! \brief Handle for computed weapon orientation.
96 //! \vreAttrKey{weaponOrientation}
98
99 //! \brief Handle for local orientation.
100 //! \vreAttrKey{localOrientation}
102
103 //! \brief Handle for local position.
104 //! \vreAttrKey{localPosition}
106};
makVrv::DtObserver * myObserver
Pointer to the observer used for view orientation.
Definition humanWeaponPoseLogic.h:78
virtual void shutdown() override
Cleans up resources when the component is being shut down.
virtual bool initialize(makVre::DtPlayerStation *player, makVre::DtInitTable &config) override
Initializes the weapon pose logic component.
makVre::DtAttributeHandleType< DtVector > myWeaponLocationAttr
Handle for computed weapon location.
Definition humanWeaponPoseLogic.h:93
makVre::DtAttributeHandleType< DtVector > myLocalPositionAttr
Handle for local position.
Definition humanWeaponPoseLogic.h:105
makVre::DtAttributeHandleType< makVre::Equipment > myCurrentEquipmentAttr
Handle for current equipment.
Definition humanWeaponPoseLogic.h:89
makVre::DtAttributeHandleType< bool > myVrEnabledAttr
Handle for VR-enabled state.
Definition humanWeaponPoseLogic.h:85
DtHumanWeaponPoseLogic()
Default constructor.
makVre::DtAttributeHandleType< DtTaitBryan > myWeaponOrientationAttr
Handle for computed weapon orientation.
Definition humanWeaponPoseLogic.h:97
void updateWeaponPosition()
Updates the weapon position and orientation.
bool myUsingVr
Flag indicating if VR mode is active.
Definition humanWeaponPoseLogic.h:81
virtual ~DtHumanWeaponPoseLogic() override
Virtual destructor.
virtual const char * type() const override
Returns the component type identifier.
makVre::DtAttributeHandleType< DtTaitBryan > myLocalOrientationAttr
Handle for local orientation.
Definition humanWeaponPoseLogic.h:101
virtual void tick(double dt) override
Updates weapon positioning for the current frame.
Type-specific handle class for attributes.
Definition attributeHandle.h:229
Table-based access to Lua state for configuration data.
Definition initializer.h:38
Base class for all role components in VR-Engage.
Definition playerComponent.h:102
virtual DtPlayerStation & player()
Gets the player station.
Class for managing the user interface for engaged roles.
Definition playerStation.h:51
constexpr const char * DtHumanWeaponPoseLogicType
Type identifier constant for DtHumanWeaponPoseLogic components.
Definition humanWeaponPoseLogic.h:32
Defines export macros for the Human Frontend library.
#define HUMAN_DLL
Definition export.h:19
Definition appLauncherComponent.h:28
Defines the DtPlayerComponent base class for VR-Engage role components.
Common enumeration definitions used throughout the VREngage system.