VR-Engage  2.2
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
13
14#include <vrvCore/DtUniqueID.h>
15#include <vrvCore/DtObserverObject.h>
16#include <vrvUtil/DtDisplayConfiguration.h>
17
18#include <matrix/vlVector.h>
19#include <matrix/vlTaitBryan.h>
20
22
23namespace makVre
24{
25
27{
28//! \ingroup RoleConfigParams
29//! \defgroup PilotObserverUpdaterRoleParams Pilot Observer Updater Role Parameters
30//! \roleInherits{PlayerComponentRoleParams}
31//! Configuration Options for pilot observer updater component.
32//! @{
33
34//! \vreRoleParam{attachOffset,DtVector,DtVector::zero(),pilotObserverUpdater,Position offset from the attachment point for the pilot observer camera.}
35constexpr const char* attachOffset = "attachOffset";
36
37//! \vreRoleParam{attachType,int,DtObserverObject::AttachTypeMimic,pilotObserverUpdater,Type of attachment behavior for the observer to the aircraft entity.}
38constexpr const char* attachType = "attachType";
39
40//! \vreRoleParam{oriOffset,DtVector,DtVector::zero(),pilotObserverUpdater,Orientation offset angles (pitch\, yaw\, roll) for the observer relative to attachment.}
41constexpr const char* oriOffset = "oriOffset";
42
43//! \vreRoleParam{rotateEntitySymbols,bool,true,pilotObserverUpdater,Whether to rotate entity symbols on displays based on aircraft orientation.}
44constexpr const char* rotateEntitySymbols = "rotateEntitySymbols";
45
46//! \vreRoleParam{smoothingPeriod,float,0.8,pilotObserverUpdater,Smoothing period in seconds for observer movement transitions.}
47constexpr const char* smoothingPeriod = "smoothingPeriod";
48
49//! @}
50} // namespace PilotObserverUpdaterConfig
51
52//! \brief Forward declaration of the interpolator class
53class DtInterpolator;
54
55//! \brief Forward declaration of the window operation message class
57
58//! \brief Forward declaration of the entity resolver class
60
61//! \brief Forward declaration of the instrument panel manager class
63} // namespace makVre
64
65namespace makVrv
66{
67//! \brief Forward declaration of the display element class
68class DtDe;
69
70//! \brief Forward declaration of the entity facade class
71class DtEntityFacade;
72
73//! \brief Forward declaration of the observer class
74class DtObserver;
75
76//! \brief Forward declaration of the scene object class
77class DtSceneObject;
78
79//! \brief Forward declaration of the window class
80class DtWindow;
81
82//! \brief Forward declaration of the input driver class
83class DtInputDriver;
84}; // namespace makVrv
85
86//! \brief Type identifier for DtPilotObserverUpdater component
87constexpr const char* DtPilotObserverUpdaterType = "DtPilotObserverUpdater";
88
89//! \brief Observer updater component for the pilot role
90//!
91//! DtPilotObserverUpdater manages the observer (camera) behavior for the pilot role,
92//! including handling different view modes, cockpit views, and external aircraft views.
93//! It handles positioning, orientation, and updates of the observer based on the
94//! aircraft state and pilot inputs.
96{
97 //! \brief Structure containing instrument panel configuration
99 {
100 std::string modelDef; //!< Model definition for the instrument panel
101 DtVector position; //!< Position of the instrument panel
102 DtVector panelSize; //!< Size of the instrument panel
103 bool isFullScreen; //!< Flag indicating whether the panel is full screen
104 };
105
106public:
107 //! \brief Default constructor
109
110 //! \brief Virtual destructor
111 virtual ~DtPilotObserverUpdater() override;
112
113 //! \brief Initializes the observer updater component
114 //! \param player Pointer to the player station
115 //! \param config Configuration settings for initialization
116 //! \return True if initialization was successful, false otherwise
118
119 //! \brief Updates the observer for the current frame
120 //! \param dt Delta time since the last frame in seconds
121 virtual void tick(double dt) override;
122
123 //! \brief Cleans up resources when the component is being shut down
124 virtual void shutdown() override;
125
126 //! \brief Returns the component type identifier
127 //! \return The component type string
128 virtual const char* type() const override;
129
130protected:
131 //! \brief Marking text for the ownship aircraft
133
134 //! \brief Pointer to the main window observer
135 makVrv::DtObserver* myMainWindowObserver;
136
137 //! \brief Unique ID of the player element
138 makVrv::DtUniqueID myPlayerElementID;
139
140 //! \brief Type of attachment for the observer
141 makVrv::DtObserverObject::AttachType myAttachType;
142
143 //! \brief Offset position for attached observer
145
146 //! \brief Orientation offset for the observer
147 DtTaitBryan myOriOffset;
148
149 //! \brief Current smoothing period for view transitions
151
152 //! \brief Previous smoothing period value
154
155 //! \brief Flag indicating if entity symbols should rotate
157
158 //! \brief Previous entity symbols rotation setting
160
161 //! \brief Previous laser designator setting
163
164 //! \brief Flag indicating if main window sensor mode needs to be reset
166
167 //! \brief Count of update ticks since initialization
169
170 //! \brief Flag indicating if a saved view is being used
172
173 //! \brief Flag indicating if the aircraft model should be shown
175};
std::string myOwnshipMarkingText
Marking text for the ownship aircraft.
Definition pilotObserverUpdater.h:132
bool myOldRotateEntitySymbols
Previous entity symbols rotation setting.
Definition pilotObserverUpdater.h:159
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:141
virtual ~DtPilotObserverUpdater() override
Virtual destructor.
float mySmoothingPeriod
Current smoothing period for view transitions.
Definition pilotObserverUpdater.h:150
bool myResetMainWindowSensorMode
Flag indicating if main window sensor mode needs to be reset.
Definition pilotObserverUpdater.h:165
bool myOldLaserDesignator
Previous laser designator setting.
Definition pilotObserverUpdater.h:162
makVrv::DtUniqueID myPlayerElementID
Unique ID of the player element.
Definition pilotObserverUpdater.h:138
float myOldSmoothingPeriod
Previous smoothing period value.
Definition pilotObserverUpdater.h:153
DtVector myAttachedOffset
Offset position for attached observer.
Definition pilotObserverUpdater.h:144
virtual bool initialize(makVre::DtPlayerStation *player, makVre::DtInitTable &config) override
Initializes the observer updater component.
DtTaitBryan myOriOffset
Orientation offset for the observer.
Definition pilotObserverUpdater.h:147
int myTickCount
Count of update ticks since initialization.
Definition pilotObserverUpdater.h:168
bool myShowModel
Flag indicating if the aircraft model should be shown.
Definition pilotObserverUpdater.h:174
bool myUsingSavedView
Flag indicating if a saved view is being used.
Definition pilotObserverUpdater.h:171
bool myRotateEntitySymbols
Flag indicating if entity symbols should rotate.
Definition pilotObserverUpdater.h:156
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:135
DtPilotObserverUpdater()
Default constructor.
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:44
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
Definition windowOperation.h:32
Base component for managing observer parameters and view settings.
constexpr const char * rotateEntitySymbols
Definition pilotObserverUpdater.h:44
constexpr const char * attachOffset
Definition pilotObserverUpdater.h:35
constexpr const char * smoothingPeriod
Definition pilotObserverUpdater.h:47
constexpr const char * oriOffset
Definition pilotObserverUpdater.h:41
constexpr const char * attachType
Definition pilotObserverUpdater.h:38
Defines export/import macros for the Pilot Frontend library.
#define PILOT_DLL
Definition export.h:19
Definition pilotObserverUpdater.h:27
Include export definitions for this library.
Definition glsVreMessageUtil.h:49
Definition appLauncherComponent.h:28
constexpr const char * DtPilotObserverUpdaterType
Type identifier for DtPilotObserverUpdater component.
Definition pilotObserverUpdater.h:87
Structure containing instrument panel configuration.
Definition pilotObserverUpdater.h:99
bool isFullScreen
Flag indicating whether the panel is full screen.
Definition pilotObserverUpdater.h:103
std::string modelDef
Model definition for the instrument panel.
Definition pilotObserverUpdater.h:100
DtVector position
Position of the instrument panel.
Definition pilotObserverUpdater.h:101
DtVector panelSize
Size of the instrument panel.
Definition pilotObserverUpdater.h:102