VR-Engage  2.2
Loading...
Searching...
No Matches
vrObserverUpdater.h
Go to the documentation of this file.
1/******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4******************************************************************************/
5
6//! \file vrObserverUpdater.h
7//! \brief Defines DtVrObserverUpdater for managing VR-specific observer effects
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 virtual reality driver class
22class DtVirtualRealityDriver;
23}; // namespace makVrv
24
25//! \brief Type identifier constant for DtVrObserverUpdater components
26//!
27//! This constant defines the string identifier used to identify DtVrObserverUpdater
28//! component types within the VR-Engage framework. It is used for component
29//! registration, type checking, and serialization operations.
30constexpr const char* DtVrObserverUpdaterType = "DtVrObserverUpdater";
31
32//! \brief VR observer updater component for visual effects
33//!
34//! DtVrObserverUpdater manages VR-specific visual effects for the observer,
35//! including blood sight effects, aiming effects, and other post-processing
36//! effects that are applied directly to the VR display. It handles enabling
37//! and disabling these effects based on player state.
39{
40public:
41 //! \brief Default constructor
43
44 //! \brief Virtual destructor
45 virtual ~DtVrObserverUpdater() override;
46
47 //! \brief Initializes the VR observer updater 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 VR visual effects 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 DtVrObserverUpdaterType.
66 virtual const char* type() const override;
67
68protected:
69 //! \brief Updates blood sight effects based on player health
70 //!
71 //! Manages the intensity and visibility of blood overlay effects that
72 //! indicate when the player is taking damage
74
75 //! \brief Updates aiming-related visual effects
76 //!
77 //! Manages visual effects that appear when the player is aiming a weapon
78 virtual void updateAimingEffects();
79
80 //! \brief Sets the enabled state of a named visual effect
81 //! \param effect Name of the effect to control
82 //! \param enabled True to enable the effect, false to disable it
83 virtual void setEffectEnabled(const std::string& effect, bool enabled);
84
85 //! \brief Pointer to the VR driver used to control effects
86 makVrv::DtVirtualRealityDriver* myVrDriver;
87
88 //! \brief Last known aiming state of the player
90};
makVrv::DtVirtualRealityDriver * myVrDriver
Pointer to the VR driver used to control effects.
Definition vrObserverUpdater.h:86
bool myLastKnownAiming
Last known aiming state of the player.
Definition vrObserverUpdater.h:89
virtual const char * type() const override
Returns the component type identifier.
virtual void tick(double dt) override
Updates VR visual effects for the current frame.
virtual bool initialize(makVre::DtPlayerStation *player, makVre::DtInitTable &config) override
Initializes the VR observer updater component.
virtual void setEffectEnabled(const std::string &effect, bool enabled)
Sets the enabled state of a named visual effect.
DtVrObserverUpdater()
Default constructor.
virtual void updateBloodSightEffects()
Updates blood sight effects based on player health.
virtual void updateAimingEffects()
Updates aiming-related visual effects.
virtual ~DtVrObserverUpdater() override
Virtual destructor.
virtual void shutdown() override
Cleans up resources when the component is being shut down.
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
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.
constexpr const char * DtVrObserverUpdaterType
Type identifier constant for DtVrObserverUpdater components.
Definition vrObserverUpdater.h:30