VR-Engage  2.2
Loading...
Searching...
No Matches
droneHudUpdater.h
Go to the documentation of this file.
1/******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4******************************************************************************/
5
6//! \file droneHudUpdater.h
7//! \brief Defines DtDroneHudUpdater for drone-specific HUD elements and overlays
8//! \ingroup vreHumanFrontend
9
10#pragma once
11
13
15
16namespace makVre
17{
18//! \brief Type identifier for DtHumanVrHudUpdater component
19constexpr const char* DtDroneHudUpdaterType = "DtDroneHudUpdater";
20
21//! \brief HUD updater component for drone operation displays
22//!
23//! DtDroneHudUpdater manages the drone-specific HUD elements including
24//! the drone view frame, battery status, distance from home, altitude,
25//! heading, and speed indicators. It updates these elements based on
26//! the current drone state and sensor information.
28{
29public:
30 //! \brief Default constructor
32
33 //! \brief Virtual destructor
34 virtual ~DtDroneHudUpdater() override;
35
36 //! \brief Initializes the drone HUD updater
37 //! \param player Pointer to the player station
38 //! \param config Configuration settings for initialization
39 //! \return True if initialization was successful, false otherwise
41
42 //! \brief Updates the drone HUD elements for the current frame
43 //! \param dt Delta time since the last frame in seconds
44 virtual void tick(double dt) override;
45
46 //! \brief Returns the component type identifier
47 //! \return The component type string
48 virtual const char* type() const override;
49
50protected:
51 //! \brief Handles changes in drone operation state
52 //! \param usingDrone True if the player is using a drone, false otherwise
53 virtual void onUsingDroneChanged(bool usingDrone);
54
55 //! \brief Called when the HUD updater is started
56 virtual void onStart() override;
57
58 //! \brief Called when the HUD updater is stopped
59 virtual void onStop() override;
60
61 //! \brief Updates all HUD elements
62 virtual void updateAll() override;
63
64 //! \brief Updates all HUD elements based on visibility
65 //! \param visible Flag indicating if the reticle is visible
66 virtual void updateHudElements(bool visible) override;
67
68 //! \brief Updates the drone display elements
69 //! \param visible Flag indicating if the drone display should be visible
70 //! \param reset Flag indicating if the display should be reset to default state
71 virtual void updateDroneDisplay(bool visible = true, bool reset = false);
72
73 //! \brief Updates the drone battery amount display
74 //! \param amount Current battery level as a percentage
75 virtual void updateDroneBatteryAmount(float amount);
76
77 //! \brief Handles resource update messages
78 //! \param msg Pointer to the message being processed
79 //! \return Message processing result
81
82 //! \brief Handles simulation state change messages
83 //! \param msg Pointer to the message being processed
84 //! \return Message processing result
86
87 //! \brief Deletes all HUD elements
88 virtual void onDeleteAll() override;
89
90 //! \brief Finds a channel by name
91 //! \param channelName Name of the channel to find, defaults to "Channel 1"
92 //! \return Pointer to the found channel, or nullptr if not found
93 virtual makVrv::DtOsgChannel* findChannel(const std::string& channelName = "Channel 1") override;
94
95 //! \brief Creates quad overlays based on the provided configurations
96 //! \param overlay Pointer to the overlay renderer
97 //! \param configs Vector of HUD image configurations to create
98 virtual void createQuads(makVrv::DtOverlayRenderer* overlay, const std::vector<HudImageConfig>& configs) override;
99
100 //! \brief Flag indicating if the drone HUD is currently visible
102
103 //! \brief Quad proxy for the drone icon display
104 makVrv::DtQuadProxy* myDrone;
105
106 //! \brief Quad proxy for the drone view frame
107 makVrv::DtQuadProxy* myDroneViewFrame;
108
109 //! \brief Text proxy for displaying battery status
110 makVrv::DtTextProxy* myBatteryText;
111
112 //! \brief Text proxy for displaying distance from home base
113 makVrv::DtTextProxy* myDistanceFromHome;
114
115 //! \brief Text proxy for displaying altitude above ground level
116 makVrv::DtTextProxy* myAgl;
117
118 //! \brief Text proxy for displaying current heading
119 makVrv::DtTextProxy* myHeading;
120
121 //! \brief Text proxy for displaying horizontal speed
122 makVrv::DtTextProxy* myHorizontalSpeed;
123
124 //! \brief Text proxy for displaying vertical speed
125 makVrv::DtTextProxy* myVerticalSpeed;
126
127 //! \brief Current drone battery amount as a percentage
129
130 //! \brief Location for wind effect requests
132
133 //! \brief Name of the channel used for drone display
134 std::string myChannelName;
135
136 //! \brief Current velocity vector of the drone
138};
139} // namespace makVre
virtual void updateDroneBatteryAmount(float amount)
Updates the drone battery amount display.
virtual void updateDroneDisplay(bool visible=true, bool reset=false)
Updates the drone display elements.
virtual const char * type() const override
Returns the component type identifier.
virtual bool initialize(makVre::DtPlayerStation *player, makVre::DtInitTable &config) override
Initializes the drone HUD updater.
virtual void onDeleteAll() override
Deletes all HUD elements.
virtual void createQuads(makVrv::DtOverlayRenderer *overlay, const std::vector< HudImageConfig > &configs) override
Creates quad overlays based on the provided configurations.
virtual makVre::DtVreMessageResult handleResourceUpdate(makVre::DtVreMessage *msg)
Handles resource update messages.
virtual void tick(double dt) override
Updates the drone HUD elements for the current frame.
virtual void updateHudElements(bool visible) override
Updates all HUD elements based on visibility.
virtual void updateAll() override
Updates all HUD elements.
makVrv::DtTextProxy * myBatteryText
Text proxy for displaying battery status.
Definition droneHudUpdater.h:110
bool myDroneHudVisible
Flag indicating if the drone HUD is currently visible.
Definition droneHudUpdater.h:101
makVrv::DtQuadProxy * myDrone
Quad proxy for the drone icon display.
Definition droneHudUpdater.h:104
makVrv::DtQuadProxy * myDroneViewFrame
Quad proxy for the drone view frame.
Definition droneHudUpdater.h:107
makVrv::DtTextProxy * myDistanceFromHome
Text proxy for displaying distance from home base.
Definition droneHudUpdater.h:113
makVrv::DtTextProxy * myVerticalSpeed
Text proxy for displaying vertical speed.
Definition droneHudUpdater.h:125
makVrv::DtTextProxy * myHorizontalSpeed
Text proxy for displaying horizontal speed.
Definition droneHudUpdater.h:122
virtual void onUsingDroneChanged(bool usingDrone)
Handles changes in drone operation state.
std::string myChannelName
Name of the channel used for drone display.
Definition droneHudUpdater.h:134
DtVector myDroneVelocity
Current velocity vector of the drone.
Definition droneHudUpdater.h:137
virtual void onStart() override
Called when the HUD updater is started.
virtual ~DtDroneHudUpdater() override
Virtual destructor.
makVrv::DtTextProxy * myAgl
Text proxy for displaying altitude above ground level.
Definition droneHudUpdater.h:116
virtual void onStop() override
Called when the HUD updater is stopped.
virtual makVre::DtVreMessageResult handleSimulationState(makVre::DtVreMessage *msg)
Handles simulation state change messages.
DtVector myWindRequestLocation
Location for wind effect requests.
Definition droneHudUpdater.h:131
double myDroneBatteryAmount
Current drone battery amount as a percentage.
Definition droneHudUpdater.h:128
makVrv::DtTextProxy * myHeading
Text proxy for displaying current heading.
Definition droneHudUpdater.h:119
virtual makVrv::DtOsgChannel * findChannel(const std::string &channelName="Channel 1") override
Finds a channel by name.
DtDroneHudUpdater()
Default constructor.
DtHudUpdater()
Constructor.
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
Abstract base class for all VREngage messages.
Definition vreMessage.h:50
Defines DtHudUpdater base class for managing HUD elements in the human role.
Defines export macros for the Human Frontend library.
#define HUMAN_DLL
Definition export.h:19
Include export definitions for this library.
Definition glsVreMessageUtil.h:49
constexpr const char * DtDroneHudUpdaterType
Type identifier for DtHumanVrHudUpdater component.
Definition droneHudUpdater.h:19
DtVreMessageResult
Enumeration of possible message handling results.
Definition vreMessage.h:33