VR-Engage  2.2
Loading...
Searching...
No Matches
spectatorSimLogic.h
Go to the documentation of this file.
1/*******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4*******************************************************************************/
5
6//! \file spectatorSimLogic.h
7//! \brief Defines the simulation logic for the spectator role
8//! \ingroup vreSpectatorFrontend
9
10#pragma once
11
13
15
16#include "vreUtil/initializer.h"
17
18namespace makVre
19{
21{
22//! \ingroup RoleConfigParams
23//! \defgroup SpectatorSimLogicRoleParams Spectator Simulation Logic Role Parameters
24//! \roleInherits{EntityControlLogicRoleParams}
25//! Configuration Options for spectator simulation logic role.
26//! @{
27
28//! \vreRoleParam{disableInputHandler,bool,false,spectatorSimLogic,Flag to disable input handler setup for manual input management.}
29constexpr const char* disableInputHandler = "disableInputHandler";
30
31//! @}
32} // namespace SpectatorSimLogicConfig
33
34//! \brief Type identifier for DtSpectatorSimLogic component
35constexpr const char* DtSpectatorSimLogicType = "DtSpectatorSimLogic";
36
37//! \brief Simulation logic component for the spectator role
38//!
39//! This component implements the simulation logic for the spectator role,
40//! managing view control, camera movement, and spectator-specific behavior.
41//! It processes view manipulation inputs, handles zoom operations, and
42//! provides spectator view control capabilities. As an entity control logic
43//! component, it also manages entity interactions in the simulation.
45{
46public:
47 //! \brief Default constructor
49
50 //! \brief Virtual destructor
51 virtual ~DtSpectatorSimLogic() override;
52
53 //! \brief Initializes the simulation logic component
54 //! \param player Pointer to the player station
55 //! \param config Reference to the initialization configuration
56 //! \return True if initialization was successful, false otherwise
57 //!
58 //! Sets up the spectator simulation logic and initializes input logic
60
61 //! \brief Updates simulation state each frame
62 //! \param dt Delta time since the last update in seconds
63 //!
64 //! Updates the spectator simulation state based on inputs and current conditions
65 virtual void tick(double dt) override;
66
67 //! \brief Performs cleanup when the component is shut down
68 //!
69 //! Releases resources and performs necessary cleanup operations
70 virtual void shutdown() override;
71
72 //! \brief Returns the component type identifier
73 //! \return The component type string
74 virtual const char* type() const override;
75
76 //! \name Input Functions
77 //! @{
78
79 //! \brief Resets the view to default position
80 //! \param val Reset magnitude (typically 1.0 for full reset)
81 //!
82 //! Returns the view to its default orientation and position
83 virtual void resetView(float val = 1);
84
85 //! \brief Adjusts the view azimuth (horizontal rotation)
86 //! \param val Azimuth adjustment value
87 //!
88 //! Rotates the view horizontally by the specified amount
89 virtual void azimuth(float val);
90
91 //! \brief Adjusts the view elevation (vertical angle)
92 //! \param val Elevation adjustment value
93 //!
94 //! Rotates the view vertically by the specified amount
95 virtual void elevation(float val);
96
97 //! \brief Zooms the view out
98 //! \param val Zoom magnitude value
99 //!
100 //! Increases the view distance by the specified amount
101 virtual void zoomOut(float val);
102
103 //! \brief Zooms the view in
104 //! \param val Zoom magnitude value
105 //!
106 //! Decreases the view distance by the specified amount
107 virtual void zoomIn(float val);
108
109 //! \brief Adjusts the view zoom level directly
110 //! \param val Zoom level value
111 //!
112 //! Sets the view zoom level to the specified value
113 virtual void zoom(float val);
114
115 //! @}
116
117protected:
118 //! \brief Input logic component for handling user inputs
119 //!
120 //! Processes user inputs and translates them into simulation actions
122};
123} // namespace makVre
Component that provides entity control functionality.
Definition entityControlLogic.h:60
Table-based access to Lua state for configuration data.
Definition initializer.h:38
Class for managing input configuration and handling in VR-Engage.
Definition inputLogic.h:35
virtual DtPlayerStation & player()
Gets the player station.
Class for managing the user interface for engaged roles.
Definition playerStation.h:51
virtual bool initialize(makVre::DtPlayerStation *player, makVre::DtInitTable &config) override
Initializes the simulation logic component.
virtual void shutdown() override
Performs cleanup when the component is shut down.
virtual void tick(double dt) override
Updates simulation state each frame.
virtual void azimuth(float val)
Adjusts the view azimuth (horizontal rotation)
virtual void resetView(float val=1)
Resets the view to default position.
virtual void zoomOut(float val)
Zooms the view out.
virtual void zoomIn(float val)
Zooms the view in.
DtInputLogic myInputLogic
Input logic component for handling user inputs.
Definition spectatorSimLogic.h:121
DtSpectatorSimLogic()
Default constructor.
virtual void elevation(float val)
Adjusts the view elevation (vertical angle)
virtual ~DtSpectatorSimLogic() override
Virtual destructor.
virtual void zoom(float val)
Adjusts the view zoom level directly.
virtual const char * type() const override
Returns the component type identifier.
Defines the logic for controlling entities in VR-Engage.
constexpr const char * disableInputHandler
Definition spectatorSimLogic.h:29
Defines export macros for the Spectator Frontend library.
#define SPECTATOR_DLL
Export/import macro for non-Windows platforms (empty)
Definition export.h:25
Provides configuration initialization for VREngage components.
Definition spectatorSimLogic.h:21
Include export definitions for this library.
Definition glsVreMessageUtil.h:49
constexpr const char * DtSpectatorSimLogicType
Type identifier for DtSpectatorSimLogic component.
Definition spectatorSimLogic.h:35