VR-Engage  2.3
Loading...
Searching...
No Matches
vreBinocularsZoomOverlay.h
Go to the documentation of this file.
1/*******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4*******************************************************************************/
5
6//! \file vreBinocularsZoomOverlay.h
7//! \brief Component for binoculars zoom status overlay
8//! \ingroup vreCommonComponents
9
10#pragma once
11
15
17
18namespace makVre
19{
20//! \brief Type identifier for DtBinocularsZoomOverlay component
21constexpr const char* DtBinocularsZoomOverlayType = "DtBinocularsZoomOverlay";
22
23//! \brief Component that provides a specialized overlay for binoculars at maximum zoom level
24//!
25//! DtBinocularsZoomOverlay extends the basic binoculars overlay with functionality
26//! specific to maximum zoom level indication. The overlay is only visible when the
27//! binoculars are at their maximum zoom level, providing a visual indication to the user
28//! that they cannot zoom in any further. It inherits core functionality from the
29//! DtBinocularsOverlay class.
31{
32public:
33 //! \brief Constructor for DtBinocularsZoomOverlay
34 //!
35 //! Initializes the component with default settings
37
38 //! \brief Virtual destructor for DtBinocularsZoomOverlay
39 virtual ~DtBinocularsZoomOverlay() override;
40
41 //! \brief Initializes the binoculars zoom overlay component
42 //! \param player Pointer to the player station this component belongs to
43 //! \param config Configuration table containing overlay settings
44 //! \return True if initialization succeeded, false otherwise
45 //!
46 //! Forwards initialization to the base class and performs any specialized setup
48 //! \brief Performs post-initialization after all components are initialized
49 //! \return True if post-initialization succeeded, false otherwise
50 //!
51 //! Completes initialization by calling the base class post-initialize
52 virtual bool postInitialize() override;
53 //! \brief Called every frame to update the overlay state
54 //! \param dt Delta time since the last frame in seconds
55 //!
56 //! Updates overlay visibility and other state based on current zoom level
57 virtual void tick(double dt) override;
58
59 //! \brief Determines if the zoom overlay should be visible
60 //! \return True if the overlay should be visible, false otherwise
61 //!
62 //! Checks if base binoculars overlay is visible and if the current
63 //! view magnification is at the maximum allowed value
64 virtual bool isOverlayVisible() override;
65
66 //! \brief Returns the type identifier for this component
67 //! \return The type string for DtBinocularsZoomOverlay
68 virtual const char* type() const override;
69
70protected:
71 //! \brief Handle for current binocular magnification.
72 //! \vreAttrKey{viewMagnification}
74 //! \brief Handle for maximum binocular magnification.
75 //! \vreAttrKey{maxViewMagnification}
77};
78} // namespace makVre
Provides handle classes for safe access to attributes.
Type-specific handle class for attributes.
Definition attributeHandle.h:229
DtBinocularsOverlay(const std::string &className="DtBinocularsOverlay")
Constructor for DtBinocularsOverlay.
DtAttributeHandleType< double > myViewMagnificationAttr
Handle for current binocular magnification.
Definition vreBinocularsZoomOverlay.h:73
virtual bool initialize(makVre::DtPlayerStation *player, makVre::DtInitTable &config) override
Initializes the binoculars zoom overlay component.
virtual void tick(double dt) override
Called every frame to update the overlay state.
virtual ~DtBinocularsZoomOverlay() override
Virtual destructor for DtBinocularsZoomOverlay.
DtBinocularsZoomOverlay()
Constructor for DtBinocularsZoomOverlay.
DtAttributeHandleType< double > myMaxViewMagnificationAttr
Handle for maximum binocular magnification.
Definition vreBinocularsZoomOverlay.h:76
virtual bool postInitialize() override
Performs post-initialization after all components are initialized.
virtual const char * type() const override
Returns the type identifier for this component.
virtual bool isOverlayVisible() override
Determines if the zoom overlay should be visible.
Table-based access to Lua state for configuration data.
Definition initializer.h:38
virtual DtPlayerStation & player()
Gets the player station.
Class for managing the user interface for engaged roles.
Definition playerStation.h:51
Defines export/import macros for the vreCommonComponents library.
#define VRECOMMONCOMPONENTS_DLL
DLL export/import macro for the vreCommonComponents library.
Definition export.h:28
!
Definition glsVreMessageUtil.h:50
constexpr const char * DtBinocularsZoomOverlayType
Type identifier for DtBinocularsZoomOverlay component.
Definition vreBinocularsZoomOverlay.h:21
Defines the DtPlayerComponent base class for VR-Engage role components.
Component for displaying binoculars reticle overlay.