VR-Engage  2.2
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
16namespace makVrv
17{
18//! \brief Forward declaration of the display element class
19class DtDe;
20
21//! \brief Forward declaration of the observer class
22class DtObserver;
23} // namespace makVrv
24
25//! \brief Type identifier constant for DtHumanWeaponPoseLogic components
26//!
27//! This constant defines the string identifier used to identify DtHumanWeaponPoseLogic
28//! component types within the VR-Engage framework. It is used for component
29//! registration, type checking, and serialization operations.
30constexpr const char* DtHumanWeaponPoseLogicType = "DtHumanWeaponPoseLogic";
31
32//! \brief Weapon pose logic component for the human role
33//!
34//! DtHumanWeaponPoseLogic manages the positioning and orientation of weapons
35//! for the human entity, handling weapon alignment with observer view and
36//! adjustments for different postures and aiming states. This component ensures
37//! weapons appear correctly positioned relative to the player's view.
39{
40public:
41 //! \brief Default constructor
43
44 //! \brief Virtual destructor
45 virtual ~DtHumanWeaponPoseLogic() override;
46
47 //! \brief Initializes the weapon pose logic component
48 //! \param player Pointer to the player station
49 //! \param config Configuration settings for initialization
50 //! \return True if initialization was successful, false otherwise
52
53 //! \brief Updates weapon positioning for the current frame
54 //! \param dt Delta time since the last frame in seconds
55 virtual void tick(double dt) override;
56
57 //! \brief Cleans up resources when the component is being shut down
58 virtual void shutdown() override;
59
60 //! \brief Returns the component type identifier
61 //! \return String identifier for this component type
62 //!
63 //! Returns the type identifier string for this component, which is used
64 //! by the VR-Engage framework for component identification and management.
65 //! The returned value matches DtHumanWeaponPoseLogicType.
66 virtual const char* type() const override;
67
68protected:
69 //! \brief Updates the weapon position and orientation
70 //!
71 //! Calculates and applies the appropriate weapon position based on the current
72 //! player state, view orientation, and VR mode settings
74
75 //! \brief Pointer to the observer used for view orientation
76 makVrv::DtObserver* myObserver;
77
78 //! \brief Flag indicating if VR mode is active
80};
makVrv::DtObserver * myObserver
Pointer to the observer used for view orientation.
Definition humanWeaponPoseLogic.h:76
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.
DtHumanWeaponPoseLogic()
Default constructor.
void updateWeaponPosition()
Updates the weapon position and orientation.
bool myUsingVr
Flag indicating if VR mode is active.
Definition humanWeaponPoseLogic.h:79
virtual ~DtHumanWeaponPoseLogic() override
Virtual destructor.
virtual const char * type() const override
Returns the component type identifier.
virtual void tick(double dt) override
Updates weapon positioning for the current frame.
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:78
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:30
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.