|
VR-Engage
2.2
|
DtDroneHudUpdater manages the drone-specific HUD elements including the drone view frame, battery status, distance from home, altitude, heading, and speed indicators. It updates these elements based on the current drone state and sensor information.
#include <droneHudUpdater.h>
Public Member Functions | |
| DtDroneHudUpdater () | |
| virtual | ~DtDroneHudUpdater () override |
| virtual bool | initialize (makVre::DtPlayerStation *player, makVre::DtInitTable &config) override |
| virtual void | tick (double dt) override |
| virtual const char * | type () const override |
Public Member Functions inherited from makVre::DtHudUpdater | |
| DtHudUpdater () | |
| virtual | ~DtHudUpdater () override |
| virtual bool | postInitialize () override |
| virtual void | shutdown () override |
| void | addItem (makVre::HudItem *item) |
| void | removeItem (makVre::HudItem *item) |
| makVrv::DtOverlayRenderer * | getOverlay () const |
| float | xPixel (const float norm) const |
| float | yPixel (const float norm) const |
| float | pixelW (const float norm) const |
| float | pixelH (const float norm) const |
Public Member Functions inherited from makVre::DtPlayerComponent | |
| DtPlayerComponent () | |
| virtual | ~DtPlayerComponent () |
| virtual void | setName (const std::string &name) |
| virtual const std::string & | name () |
| virtual DtPlayerStation & | player () |
| virtual DtAttributeHandle & | playerAttributeStore () |
| virtual const DtAttributeHandle & | playerAttributeStore () const |
Protected Member Functions | |
| virtual void | onUsingDroneChanged (bool usingDrone) |
| virtual void | onStart () override |
| virtual void | onStop () override |
| virtual void | updateAll () override |
| virtual void | updateHudElements (bool visible) override |
| virtual void | updateDroneDisplay (bool visible=true, bool reset=false) |
| virtual void | updateDroneBatteryAmount (float amount) |
| virtual makVre::DtVreMessageResult | handleResourceUpdate (makVre::DtVreMessage *msg) |
| virtual makVre::DtVreMessageResult | handleSimulationState (makVre::DtVreMessage *msg) |
| virtual void | onDeleteAll () override |
| virtual makVrv::DtOsgChannel * | findChannel (const std::string &channelName="Channel 1") override |
| virtual void | createQuads (makVrv::DtOverlayRenderer *overlay, const std::vector< HudImageConfig > &configs) override |
Protected Member Functions inherited from makVre::DtHudUpdater | |
| double | headingAngleTo (const DtVector &geocentricObserverPosition, const DtVector &geocentricTargetPosition) |
| virtual void | start () |
| virtual void | stop () |
| virtual void | setupOverlays () |
| virtual void | channelDestroyed (const std::string &displayName, const std::string &windowName, const std::string &channelName) |
| virtual void | onViewportChanged () |
| virtual void | deleteAll () |
| virtual makVrv::DtOverlayRenderer * | createOverlay (makVrv::DtOsgChannel *channel, osg::Geode *&geodeOut) |
| virtual void | setupQuads () |
| void | slot_onChannelCreated () |
| void | slot_onChannelToBeDestroyed () |
| virtual osg::Texture * | createTexture (std::string path) |
| virtual makVrv::DtQuadProxy * | createQuad (makVrv::DtOverlayRenderer *overlay, const HudImageConfig &config) |
| virtual makVrv::DtQuadProxy * | createQuadWithColor (makVrv::DtOverlayRenderer *overlay, const HudColorQuadConfig &element) |
| virtual bool | loadImageConfig (unsigned int e, makVre::DtInitTable &imageTable, std::string imageName, bool loadDimensions=true) |
| virtual bool | loadTextConfig (unsigned int t, makVre::DtInitTable &textTable, std::string textName) |
| virtual bool | loadColorQuadConfig (unsigned int quadIndex, makVre::DtInitTable &colorQuadTable, std::string colorQuadName, bool loadDimensions=true) |
| virtual bool | loadColorConfig (makVre::DtColor &colorInfo, makVre::DtInitTable &colorTable, std::string colorName) |
| virtual bool | loadValueColorPairsConfig (std::vector< HudValueColorPair > &valueColorPairsContainer, makVre::DtInitTable &hudTable, const std::string &valueColorPairsName) |
| virtual bool | loadValueColorPairConfig (HudValueColorPair &valueColorPair, makVre::DtInitTable &valueColorPairConfig) |
| makVrv::DtTextProxy * | createAndInitTextProxy (double normalizedX, double normalizedY, const std::string &defaultText) |
| virtual makVre::DtVreMessageResult | handleEnterPlayerState (makVre::DtVreMessage *msg) |
| virtual makVre::DtVreMessageResult | handleExitPlayerState (makVre::DtVreMessage *msg) |
| virtual enum Layers | overlayGroup () |
Protected Member Functions inherited from makVre::DtPlayerComponent | |
| virtual void | initializeStateAttributes () |
Protected Attributes | |
| bool | myDroneHudVisible |
| makVrv::DtQuadProxy * | myDrone |
| makVrv::DtQuadProxy * | myDroneViewFrame |
| makVrv::DtTextProxy * | myBatteryText |
| makVrv::DtTextProxy * | myDistanceFromHome |
| makVrv::DtTextProxy * | myAgl |
| makVrv::DtTextProxy * | myHeading |
| makVrv::DtTextProxy * | myHorizontalSpeed |
| makVrv::DtTextProxy * | myVerticalSpeed |
| double | myDroneBatteryAmount |
| DtVector | myWindRequestLocation |
| std::string | myChannelName |
| DtVector | myDroneVelocity |
Protected Attributes inherited from makVre::DtHudUpdater | |
| std::map< const makVre::HudTextItem *, std::pair< makVre::HudTextItem *, makVrv::DtTextProxy * > > | myTextItemMap |
| std::map< const makVre::HudImageItem *, std::pair< makVre::HudImageItem *, makVrv::DtQuadProxy * > > | myImageItemMap |
| bool | myActive |
| DtAttributeHandleType< bool > | myUsingVr |
| std::vector< HudImageConfig > | myImages |
| std::vector< HudColorQuadConfig > | myColorQuads |
| std::vector< HudTextConfig > | myTexts |
| makVrv::DtOverlayRenderer * | myOverlayInterface |
| makVrv::DtOsgChannel * | myChannel |
| float | myFontSize |
| makVrv::DtFontInterface * | myFont |
| std::string | myFontFilePath |
| int | myLineHeight |
| osg::Geode * | myGeode |
| bool | myChannelsUpdated |
| bool | myShowOverlays |
Protected Attributes inherited from makVre::DtPlayerComponent | |
| std::string | myName |
| DtInitTable | myConfig |
| DtPlayerStation * | myPlayer |
| makVrv::DtDe * | myDe |
| DtEntityResolver * | myResolver |
| DtAttributeCallbackManager | myAttributeCallbacks |
Additional Inherited Members | |
Protected Types inherited from makVre::DtHudUpdater | |
| enum | Layers { HIDDEN = 0 , OVERLAY = 1 , UI = 2 } |
| makVre::DtDroneHudUpdater::DtDroneHudUpdater | ( | ) |
Default constructor.
|
overridevirtual |
Virtual destructor.
|
overridevirtual |
Initializes the drone HUD updater.
| player | Pointer to the player station |
| config | Configuration settings for initialization |
Reimplemented from makVre::DtHudUpdater.
References makVre::DtPlayerComponent::player().
|
overridevirtual |
Updates the drone HUD elements for the current frame.
| dt | Delta time since the last frame in seconds |
Reimplemented from makVre::DtHudUpdater.
|
overridevirtual |
Returns the component type identifier.
Reimplemented from makVre::DtHudUpdater.
|
protectedvirtual |
Handles changes in drone operation state.
| usingDrone | True if the player is using a drone, false otherwise |
|
overrideprotectedvirtual |
Called when the HUD updater is started.
Implements makVre::DtHudUpdater.
|
overrideprotectedvirtual |
Called when the HUD updater is stopped.
Implements makVre::DtHudUpdater.
|
overrideprotectedvirtual |
Updates all HUD elements.
Reimplemented from makVre::DtHudUpdater.
|
overrideprotectedvirtual |
Updates all HUD elements based on visibility.
| visible | Flag indicating if the reticle is visible |
Implements makVre::DtHudUpdater.
|
protectedvirtual |
Updates the drone display elements.
| visible | Flag indicating if the drone display should be visible |
| reset | Flag indicating if the display should be reset to default state |
|
protectedvirtual |
Updates the drone battery amount display.
| amount | Current battery level as a percentage |
|
protectedvirtual |
Handles resource update messages.
| msg | Pointer to the message being processed |
|
protectedvirtual |
Handles simulation state change messages.
| msg | Pointer to the message being processed |
|
overrideprotectedvirtual |
Deletes all HUD elements.
Implements makVre::DtHudUpdater.
|
overrideprotectedvirtual |
Finds a channel by name.
| channelName | Name of the channel to find, defaults to "Channel 1" |
Reimplemented from makVre::DtHudUpdater.
|
overrideprotectedvirtual |
Creates quad overlays based on the provided configurations.
| overlay | Pointer to the overlay renderer |
| configs | Vector of HUD image configurations to create |
Implements makVre::DtHudUpdater.
|
protected |
Flag indicating if the drone HUD is currently visible.
|
protected |
Quad proxy for the drone icon display.
|
protected |
Quad proxy for the drone view frame.
|
protected |
Text proxy for displaying battery status.
|
protected |
Text proxy for displaying distance from home base.
|
protected |
Text proxy for displaying altitude above ground level.
|
protected |
Text proxy for displaying current heading.
|
protected |
Text proxy for displaying horizontal speed.
|
protected |
Text proxy for displaying vertical speed.
|
protected |
Current drone battery amount as a percentage.
|
protected |
Location for wind effect requests.
|
protected |
Name of the channel used for drone display.
|
protected |
Current velocity vector of the drone.