VR-Engage  2.2
Loading...
Searching...
No Matches
settingsOverrideComponent.h
Go to the documentation of this file.
1/*******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4*******************************************************************************/
5
6//! \file settingsOverrideComponent.h
7//! \brief Component for overriding and restoring rendering settings per role
8//! \ingroup vreCommonComponents
9
10#pragma once
11
14
15#include <makArchives/DtShadowSettingsCollectionRecord.h>
16
17namespace makVrv
18{
19class DtObserver;
20}
21
22namespace makVre
23{
25{
26//! \ingroup RoleConfigParams
27//! \defgroup SettingsOverrideComponentRoleParams Settings Override Component Role Parameters
28//! \roleInherits{PlayerComponentRoleParams}
29//! Configuration Options for settings override component role.
30//! @{
31
32//! \vreRoleParam{disableHbao,bool,false,settingsOverrideComponent,Whether to disable Horizon Based Ambient Occlusion (HBAO) graphics setting for this role.}
33constexpr const char* disableHbao = "disableHbao";
34
35//! \vreRoleParam{disableHdr,bool,false,settingsOverrideComponent,Whether to disable High Dynamic Range (HDR) graphics setting for this role.}
36constexpr const char* disableHdr = "disableHdr";
37
38//! \vreRoleParam{shadowSettingsFile,string,"",settingsOverrideComponent,Path to shadow settings file for overriding shadow configuration during role engagement.}
39constexpr const char* shadowSettingsFile = "shadowSettingsFile";
40
41//! @}
42} // namespace SettingsOverrideComponentConfig
43
44//! \brief Type identifier for DtSettingsOverrideComponent component
45constexpr const char* DtSettingsOverrideComponentType = "DtSettingsOverrideComponent";
46
47//! \brief Component that temporarily overrides graphics settings for specific roles
48//!
49//! DtSettingsOverrideComponent provides functionality to override graphics settings
50//! such as shadow quality, HDR, and HBAO during role engagement, and then restore
51//! the original settings when the role is exited. This allows roles to have
52//! customized graphics settings that optimize performance or visual quality for
53//! specific operational needs without permanently changing the user's preferences.
55{
56public:
57 //! \brief Constructor for DtSettingsOverrideComponent
58 //!
59 //! Initializes the component with default settings and empty restoration maps
61
62 //! \brief Virtual destructor for DtSettingsOverrideComponent
63 virtual ~DtSettingsOverrideComponent() override;
64
65 //! \brief Initializes the settings override component
66 //! \param player Pointer to the player station this component belongs to
67 //! \param config Configuration table containing override settings
68 //! \return True if initialization succeeded, false otherwise
69 //!
70 //! Reads configuration settings for shadow quality, HBAO, and HDR overrides,
71 //! applies the specified overrides, and caches original settings for restoration
73 //! \brief Called every frame to update the component state
74 //! \param dt Delta time since the last frame in seconds
75 //!
76 //! Current implementation is empty as the component operates on initialization and shutdown
77 virtual void tick(double dt) override;
78 //! \brief Shuts down the settings override component
79 //!
80 //! Restores all previously cached graphics settings to their original values
81 //! before the component was initialized
82 virtual void shutdown() override;
83
84 //! \brief Returns the type identifier for this component
85 //! \return The type string for DtSettingsOverrideComponent
86 virtual const char* type() const override;
87
88protected:
89 //! \brief Handler for observer mode change events
90 //! \param observer Pointer to the observer that changed modes
91 //! \param newMode New observer mode index
92 //!
93 //! When the observer changes to a mode not previously cached, this function
94 //! captures the current HBAO setting and disables it if necessary
95 void slot_observerModeChanged(makVrv::DtObserver* observer, int newMode);
96
97protected:
98 //! \brief Flag indicating if shadow settings need to be restored on shutdown
100
101 //! \brief Original shadow settings cached during initialization
102 makArchives::DtShadowSettingsCollectionRecord myOriginalShadowSettings;
103
104 //! \brief Original HDR state to restore on shutdown
106
107 //! \brief Map of observer modes to their original HBAO settings
108 //!
109 //! Maps observer mode IDs to the original HBAO enabled state for restoration
110 std::map<int, bool> myHbaoRestoreMap;
111};
112} // namespace makVre
Table-based access to Lua state for configuration data.
Definition initializer.h:38
virtual DtPlayerStation & player()
Gets the player station.
DtPlayerComponent()
Constructor.
Class for managing the user interface for engaged roles.
Definition playerStation.h:51
virtual ~DtSettingsOverrideComponent() override
Virtual destructor for DtSettingsOverrideComponent.
virtual void shutdown() override
Shuts down the settings override component.
std::map< int, bool > myHbaoRestoreMap
Map of observer modes to their original HBAO settings.
Definition settingsOverrideComponent.h:110
bool myRestoreShadowSettings
Flag indicating if shadow settings need to be restored on shutdown.
Definition settingsOverrideComponent.h:99
bool myRestoreHdr
Original HDR state to restore on shutdown.
Definition settingsOverrideComponent.h:105
void slot_observerModeChanged(makVrv::DtObserver *observer, int newMode)
Handler for observer mode change events.
DtSettingsOverrideComponent()
Constructor for DtSettingsOverrideComponent.
virtual void tick(double dt) override
Called every frame to update the component state.
makArchives::DtShadowSettingsCollectionRecord myOriginalShadowSettings
Original shadow settings cached during initialization.
Definition settingsOverrideComponent.h:102
virtual const char * type() const override
Returns the type identifier for this component.
virtual bool initialize(makVre::DtPlayerStation *player, makVre::DtInitTable &config) override
Initializes the settings override component.
constexpr const char * disableHbao
Definition settingsOverrideComponent.h:33
constexpr const char * shadowSettingsFile
Definition settingsOverrideComponent.h:39
constexpr const char * disableHdr
Definition settingsOverrideComponent.h:36
Defines export/import macros for the vreCommonComponents library.
#define VRECOMMONCOMPONENTS_DLL
DLL export/import macro for the vreCommonComponents library.
Definition export.h:28
Definition settingsOverrideComponent.h:25
Include export definitions for this library.
Definition glsVreMessageUtil.h:49
constexpr const char * DtSettingsOverrideComponentType
Type identifier for DtSettingsOverrideComponent component.
Definition settingsOverrideComponent.h:45
Definition appLauncherComponent.h:28
Defines the DtPlayerComponent base class for VR-Engage role components.