VR-Engage  2.2
Loading...
Searching...
No Matches
makVre::DtDroneHudUpdater Class Reference

Detailed Description

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>

Inheritance diagram for makVre::DtDroneHudUpdater:
[legend]

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 DtPlayerStationplayer ()
 
virtual DtAttributeHandleplayerAttributeStore ()
 
virtual const DtAttributeHandleplayerAttributeStore () 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< HudImageConfigmyImages
 
std::vector< HudColorQuadConfigmyColorQuads
 
std::vector< HudTextConfigmyTexts
 
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
 
DtPlayerStationmyPlayer
 
makVrv::DtDe * myDe
 
DtEntityResolvermyResolver
 
DtAttributeCallbackManager myAttributeCallbacks
 

Additional Inherited Members

- Protected Types inherited from makVre::DtHudUpdater
enum  Layers { HIDDEN = 0 , OVERLAY = 1 , UI = 2 }
 

Constructor & Destructor Documentation

◆ DtDroneHudUpdater()

makVre::DtDroneHudUpdater::DtDroneHudUpdater ( )

Default constructor.

◆ ~DtDroneHudUpdater()

virtual makVre::DtDroneHudUpdater::~DtDroneHudUpdater ( )
overridevirtual

Virtual destructor.

Member Function Documentation

◆ initialize()

virtual bool makVre::DtDroneHudUpdater::initialize ( makVre::DtPlayerStation * player,
makVre::DtInitTable & config )
overridevirtual

Initializes the drone HUD updater.

Parameters
playerPointer to the player station
configConfiguration settings for initialization
Returns
True if initialization was successful, false otherwise

Reimplemented from makVre::DtHudUpdater.

References makVre::DtPlayerComponent::player().

◆ tick()

virtual void makVre::DtDroneHudUpdater::tick ( double dt)
overridevirtual

Updates the drone HUD elements for the current frame.

Parameters
dtDelta time since the last frame in seconds

Reimplemented from makVre::DtHudUpdater.

◆ type()

virtual const char * makVre::DtDroneHudUpdater::type ( ) const
overridevirtual

Returns the component type identifier.

Returns
The component type string

Reimplemented from makVre::DtHudUpdater.

◆ onUsingDroneChanged()

virtual void makVre::DtDroneHudUpdater::onUsingDroneChanged ( bool usingDrone)
protectedvirtual

Handles changes in drone operation state.

Parameters
usingDroneTrue if the player is using a drone, false otherwise

◆ onStart()

virtual void makVre::DtDroneHudUpdater::onStart ( )
overrideprotectedvirtual

Called when the HUD updater is started.

Implements makVre::DtHudUpdater.

◆ onStop()

virtual void makVre::DtDroneHudUpdater::onStop ( )
overrideprotectedvirtual

Called when the HUD updater is stopped.

Implements makVre::DtHudUpdater.

◆ updateAll()

virtual void makVre::DtDroneHudUpdater::updateAll ( )
overrideprotectedvirtual

Updates all HUD elements.

Reimplemented from makVre::DtHudUpdater.

◆ updateHudElements()

virtual void makVre::DtDroneHudUpdater::updateHudElements ( bool visible)
overrideprotectedvirtual

Updates all HUD elements based on visibility.

Parameters
visibleFlag indicating if the reticle is visible

Implements makVre::DtHudUpdater.

◆ updateDroneDisplay()

virtual void makVre::DtDroneHudUpdater::updateDroneDisplay ( bool visible = true,
bool reset = false )
protectedvirtual

Updates the drone display elements.

Parameters
visibleFlag indicating if the drone display should be visible
resetFlag indicating if the display should be reset to default state

◆ updateDroneBatteryAmount()

virtual void makVre::DtDroneHudUpdater::updateDroneBatteryAmount ( float amount)
protectedvirtual

Updates the drone battery amount display.

Parameters
amountCurrent battery level as a percentage

◆ handleResourceUpdate()

virtual makVre::DtVreMessageResult makVre::DtDroneHudUpdater::handleResourceUpdate ( makVre::DtVreMessage * msg)
protectedvirtual

Handles resource update messages.

Parameters
msgPointer to the message being processed
Returns
Message processing result

◆ handleSimulationState()

virtual makVre::DtVreMessageResult makVre::DtDroneHudUpdater::handleSimulationState ( makVre::DtVreMessage * msg)
protectedvirtual

Handles simulation state change messages.

Parameters
msgPointer to the message being processed
Returns
Message processing result

◆ onDeleteAll()

virtual void makVre::DtDroneHudUpdater::onDeleteAll ( )
overrideprotectedvirtual

Deletes all HUD elements.

Implements makVre::DtHudUpdater.

◆ findChannel()

virtual makVrv::DtOsgChannel * makVre::DtDroneHudUpdater::findChannel ( const std::string & channelName = "Channel 1")
overrideprotectedvirtual

Finds a channel by name.

Parameters
channelNameName of the channel to find, defaults to "Channel 1"
Returns
Pointer to the found channel, or nullptr if not found

Reimplemented from makVre::DtHudUpdater.

◆ createQuads()

virtual void makVre::DtDroneHudUpdater::createQuads ( makVrv::DtOverlayRenderer * overlay,
const std::vector< HudImageConfig > & configs )
overrideprotectedvirtual

Creates quad overlays based on the provided configurations.

Parameters
overlayPointer to the overlay renderer
configsVector of HUD image configurations to create

Implements makVre::DtHudUpdater.

Member Data Documentation

◆ myDroneHudVisible

bool makVre::DtDroneHudUpdater::myDroneHudVisible
protected

Flag indicating if the drone HUD is currently visible.

◆ myDrone

makVrv::DtQuadProxy* makVre::DtDroneHudUpdater::myDrone
protected

Quad proxy for the drone icon display.

◆ myDroneViewFrame

makVrv::DtQuadProxy* makVre::DtDroneHudUpdater::myDroneViewFrame
protected

Quad proxy for the drone view frame.

◆ myBatteryText

makVrv::DtTextProxy* makVre::DtDroneHudUpdater::myBatteryText
protected

Text proxy for displaying battery status.

◆ myDistanceFromHome

makVrv::DtTextProxy* makVre::DtDroneHudUpdater::myDistanceFromHome
protected

Text proxy for displaying distance from home base.

◆ myAgl

makVrv::DtTextProxy* makVre::DtDroneHudUpdater::myAgl
protected

Text proxy for displaying altitude above ground level.

◆ myHeading

makVrv::DtTextProxy* makVre::DtDroneHudUpdater::myHeading
protected

Text proxy for displaying current heading.

◆ myHorizontalSpeed

makVrv::DtTextProxy* makVre::DtDroneHudUpdater::myHorizontalSpeed
protected

Text proxy for displaying horizontal speed.

◆ myVerticalSpeed

makVrv::DtTextProxy* makVre::DtDroneHudUpdater::myVerticalSpeed
protected

Text proxy for displaying vertical speed.

◆ myDroneBatteryAmount

double makVre::DtDroneHudUpdater::myDroneBatteryAmount
protected

Current drone battery amount as a percentage.

◆ myWindRequestLocation

DtVector makVre::DtDroneHudUpdater::myWindRequestLocation
protected

Location for wind effect requests.

◆ myChannelName

std::string makVre::DtDroneHudUpdater::myChannelName
protected

Name of the channel used for drone display.

◆ myDroneVelocity

DtVector makVre::DtDroneHudUpdater::myDroneVelocity
protected

Current velocity vector of the drone.


The documentation for this class was generated from the following file: