VR-Engage  2.3
Loading...
Searching...
No Matches
pilotObserverUpdater.h
Go to the documentation of this file.
1/******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4******************************************************************************/
5
6//! \file pilotObserverUpdater.h
7//! \brief Defines DtPilotObserverUpdater for managing pilot-specific camera views
8//! \ingroup vrePilotFrontend
9
10#pragma once
11
14
15#include <vrvCore/DtUniqueID.h>
16#include <vrvCore/DtObserverObject.h>
17#include <vrvUtil/DtDisplayConfiguration.h>
18
19#include <matrix/vlVector.h>
20#include <matrix/vlTaitBryan.h>
21
23
24namespace makVre
25{
26
28{
29//! \ingroup RoleConfigParams
30//! \defgroup PilotObserverUpdaterRoleParams Pilot Observer Updater Role Parameters
31//! \roleInherits{PlayerComponentRoleParams}
32//! Configuration Options for pilot observer updater component.
33//! @{
34
35//! \vreRoleParam{attachOffset,DtVector,DtVector::zero(),pilotObserverUpdater,Position offset from the attachment point for the pilot observer camera.}
36constexpr const char* attachOffset = "attachOffset";
37
38//! \vreRoleParam{attachType,int,DtObserverObject::AttachTypeMimic,pilotObserverUpdater,Type of attachment behavior for the observer to the aircraft entity.}
39constexpr const char* attachType = "attachType";
40
41//! \vreRoleParam{oriOffset,DtVector,DtVector::zero(),pilotObserverUpdater,Orientation offset angles (pitch\, yaw\, roll) for the observer relative to attachment.}
42constexpr const char* oriOffset = "oriOffset";
43
44//! \vreRoleParam{rotateEntitySymbols,bool,true,pilotObserverUpdater,Whether to rotate entity symbols on displays based on aircraft orientation.}
45constexpr const char* rotateEntitySymbols = "rotateEntitySymbols";
46
47//! \vreRoleParam{smoothingPeriod,float,0.8,pilotObserverUpdater,Smoothing period in seconds for observer movement transitions.}
48constexpr const char* smoothingPeriod = "smoothingPeriod";
49
50//! @}
51} // namespace PilotObserverUpdaterConfig
52
53//! \brief Forward declaration of the interpolator class
54class DtInterpolator;
55
56//! \brief Forward declaration of the window operation message class
58
59//! \brief Forward declaration of the entity resolver class
61
62//! \brief Forward declaration of the instrument panel manager class
64} // namespace makVre
65
66namespace makVrv
67{
68//! \brief Forward declaration of the display element class
69class DtDe;
70
71//! \brief Forward declaration of the entity facade class
72class DtEntityFacade;
73
74//! \brief Forward declaration of the observer class
75class DtObserver;
76
77//! \brief Forward declaration of the scene object class
78class DtSceneObject;
79
80//! \brief Forward declaration of the window class
81class DtWindow;
82
83//! \brief Forward declaration of the input driver class
84class DtInputDriver;
85}; // namespace makVrv
86
87//! \brief Type identifier for DtPilotObserverUpdater component
88constexpr const char* DtPilotObserverUpdaterType = "DtPilotObserverUpdater";
89
90//! \brief Observer updater component for the pilot role
91//!
92//! DtPilotObserverUpdater manages the observer (camera) behavior for the pilot role,
93//! including handling different view modes, cockpit views, and external aircraft views.
94//! It handles positioning, orientation, and updates of the observer based on the
95//! aircraft state and pilot inputs.
97{
98 //! \brief Structure containing instrument panel configuration
100 {
101 std::string modelDef; //!< Model definition for the instrument panel
102 DtVector position; //!< Position of the instrument panel
103 DtVector panelSize; //!< Size of the instrument panel
104 bool isFullScreen; //!< Flag indicating whether the panel is full screen
105 };
106
107public:
108 //! \brief Default constructor
110
111 //! \brief Virtual destructor
112 virtual ~DtPilotObserverUpdater() override;
113
114 //! \brief Initializes the observer updater component
115 //! \param player Pointer to the player station
116 //! \param config Configuration settings for initialization
117 //! \return True if initialization was successful, false otherwise
119
120 //! \brief Called after postInitialize() to complete one-time observer setup
121 //! \param dt Delta time since the last frame in seconds
122 //! \return Ready once mimic attachment and terrain signal are sent
123 //!
124 //! Sets the observer to mimic attach mode and re-sends the ocean height map
125 //! resolution to ensure correct terrain realization. Runs during the
126 //! LOADING_PLAYER_STATE phase before the engaged tick loop.
127 virtual makVre::DtInitTickStatus finalizeInitTick(double dt) override;
128
129 //! \brief Updates the observer for the current frame
130 //! \param dt Delta time since the last frame in seconds
131 virtual void tick(double dt) override;
132
133 //! \brief Cleans up resources when the component is being shut down
134 virtual void shutdown() override;
135
136 //! \brief Returns the component type identifier
137 //! \return The component type string
138 virtual const char* type() const override;
139
140protected:
141 //! \brief Marking text for the ownship aircraft
143
144 //! \brief Pointer to the main window observer
145 makVrv::DtObserver* myMainWindowObserver;
146
147 //! \brief Unique ID of the player element
148 makVrv::DtUniqueID myPlayerElementID;
149
150 //! \brief Type of attachment for the observer
151 makVrv::DtObserverObject::AttachType myAttachType;
152
153 //! \brief Offset position for attached observer
155
156 //! \brief Orientation offset for the observer
157 DtTaitBryan myOriOffset;
158
159 //! \brief Tracks temporary laser designator settings applied by this component.
161
162 //! \brief Flag indicating if main window sensor mode needs to be reset
164
165 //! \brief Flag indicating if a saved view is being used
167
168 //! \brief Flag indicating if the aircraft model should be shown
170
171 //! \brief Attribute handle storing the ownship's current damage state.
172 //! \vreAttrKey{ownship.damageState}
174
175 //! \brief Attribute handle indicating whether the mimic offset mode is active.
176 //! \vreAttrKey{mimicOffset}
178
179 //! \brief Attribute handle indicating whether the real cockpit model should be displayed.
180 //! \vreAttrKey{realCockpit}
182};
virtual makVre::DtInitTickStatus finalizeInitTick(double dt) override
Called after postInitialize() to complete one-time observer setup.
std::string myOwnshipMarkingText
Marking text for the ownship aircraft.
Definition pilotObserverUpdater.h:142
virtual void tick(double dt) override
Updates the observer for the current frame.
makVrv::DtObserverObject::AttachType myAttachType
Type of attachment for the observer.
Definition pilotObserverUpdater.h:151
makVre::DtSettingsOverrideGuard mySettingsOverrideGuard
Tracks temporary laser designator settings applied by this component.
Definition pilotObserverUpdater.h:160
virtual ~DtPilotObserverUpdater() override
Virtual destructor.
bool myResetMainWindowSensorMode
Flag indicating if main window sensor mode needs to be reset.
Definition pilotObserverUpdater.h:163
makVrv::DtUniqueID myPlayerElementID
Unique ID of the player element.
Definition pilotObserverUpdater.h:148
makVre::DtAttributeHandleType< bool > myMimicOffsetAttr
Attribute handle indicating whether the mimic offset mode is active.
Definition pilotObserverUpdater.h:177
DtVector myAttachedOffset
Offset position for attached observer.
Definition pilotObserverUpdater.h:154
virtual bool initialize(makVre::DtPlayerStation *player, makVre::DtInitTable &config) override
Initializes the observer updater component.
makVre::DtAttributeHandleType< DtDamageState > myDamageStateAttr
Attribute handle storing the ownship's current damage state.
Definition pilotObserverUpdater.h:173
DtTaitBryan myOriOffset
Orientation offset for the observer.
Definition pilotObserverUpdater.h:157
bool myShowModel
Flag indicating if the aircraft model should be shown.
Definition pilotObserverUpdater.h:169
bool myUsingSavedView
Flag indicating if a saved view is being used.
Definition pilotObserverUpdater.h:166
makVre::DtAttributeHandleType< bool > myRealCockpitAttr
Attribute handle indicating whether the real cockpit model should be displayed.
Definition pilotObserverUpdater.h:181
virtual const char * type() const override
Returns the component type identifier.
virtual void shutdown() override
Cleans up resources when the component is being shut down.
makVrv::DtObserver * myMainWindowObserver
Pointer to the main window observer.
Definition pilotObserverUpdater.h:145
DtPilotObserverUpdater()
Default constructor.
Type-specific handle class for attributes.
Definition attributeHandle.h:229
Entity resolution and mapping system.
Definition entityResolver.h:52
Table-based access to Lua state for configuration data.
Definition initializer.h:38
Manager for instrument panels, gimbal sensors, and specialized views.
Definition instrumentPanelManager.h:45
Base component for managing observer view parameters and display settings.
Definition observerUpdater.h:83
virtual DtPlayerStation & player()
Gets the player station.
Class for managing the user interface for engaged roles.
Definition playerStation.h:51
Tracks temporary settings overrides and conditionally restores them.
Definition settingsOverrideGuard.h:180
Used to create, modify or destroy a window or channel.
Definition windowOperation.h:36
Base component for managing observer parameters and view settings.
constexpr const char * rotateEntitySymbols
Definition pilotObserverUpdater.h:45
constexpr const char * attachOffset
Definition pilotObserverUpdater.h:36
constexpr const char * smoothingPeriod
Definition pilotObserverUpdater.h:48
constexpr const char * oriOffset
Definition pilotObserverUpdater.h:42
constexpr const char * attachType
Definition pilotObserverUpdater.h:39
Defines export/import macros for the Pilot Frontend library.
#define PILOT_DLL
Definition export.h:19
Definition pilotObserverUpdater.h:28
!
Definition glsVreMessageUtil.h:50
DtInitTickStatus
Status returned by DtPlayerComponent::finalizeInitTick() to indicate deferred initialization progress...
Definition playerComponent.h:80
Definition appLauncherComponent.h:28
constexpr const char * DtPilotObserverUpdaterType
Type identifier for DtPilotObserverUpdater component.
Definition pilotObserverUpdater.h:88
Defines a guard for temporary, non-persistent settings overrides.
Structure containing instrument panel configuration.
Definition pilotObserverUpdater.h:100
bool isFullScreen
Flag indicating whether the panel is full screen.
Definition pilotObserverUpdater.h:104
std::string modelDef
Model definition for the instrument panel.
Definition pilotObserverUpdater.h:101
DtVector position
Position of the instrument panel.
Definition pilotObserverUpdater.h:102
DtVector panelSize
Size of the instrument panel.
Definition pilotObserverUpdater.h:103