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

Detailed Description

DtHumanHudUpdater manages the HUD elements specific to the human role, including weapon indicators, ammo counters, health and fatigue bars, crosshairs, and posture indicators. It handles positioning, visibility, and updates of these elements based on the player state.

#include <humanHudUpdater.h>

Inheritance diagram for makVre::DtHumanHudUpdater:
[legend]

Classes

struct  Extent2D
 

Public Member Functions

 DtHumanHudUpdater ()
 
virtual ~DtHumanHudUpdater () override
 
virtual bool initialize (makVre::DtPlayerStation *player, makVre::DtInitTable &config) override
 
virtual bool postInitialize () 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 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 Types

enum  Textures {
  NVG_OVERLAY , WEAPON_AIMING_OVERLAY , HEALTH_BAR_BACKER , FATIGUE_BAR_BACKER ,
  STANDING_TEX , CROUCHING_TEX , PRONE_TEX , KNEELING_TEX ,
  CIVILIAN_STANDING_TEX , CIVILIAN_CROUCHING_TEX , CIVILIAN_PRONE_TEX , CIVILIAN_KNEELING_TEX ,
  CROSSHAIR , NVG_CROSSHAIR , CURRENT_WEAPON , CURRENT_WEAPON_STOWED ,
  CURRENT_WEAPON_DOWN , WEAPON_PROTOTYPE , MISSILE_LAUNCHER , DRONE_TEX ,
  DRONE_VIEW_FRAME , FIRST_WEAPON_TEXTURE , TEXTURES_CONFIG_COUNT
}
 
enum  ColorQuads { HEALTH_BAR , FATIGUE_BAR , COLOR_QUADS_CONFIG_COUNT }
 
enum  Texts {
  PARACHUTE_WIND_SPEED , PARACHUTE_WIND_DIRECTION , PARACHUTE_OXYGEN_PERCENT , PARACHUTE_ALTITUDE ,
  TEXT_HEALTH , TEXT_FATIGUE , TEXT_CONFIG_COUNT
}
 
- Protected Types inherited from makVre::DtHudUpdater
enum  Layers { HIDDEN = 0 , OVERLAY = 1 , UI = 2 }
 

Protected Member Functions

virtual void onStart () override
 
virtual void onStop () override
 
virtual bool loadWeaponIconExtentConfig (makVre::DtInitTable &initTable, std::string tableName)
 
virtual bool loadWeaponIconPositionsConfig (makVre::DtInitTable &initTable, std::string tableName)
 
virtual void weaponIconPosition (unsigned i, unsigned total, float &x, float &y) const
 
virtual void ammoTextPosition (unsigned i, unsigned total, float &x, float &y) const
 
virtual void clipTextPosition (unsigned i, unsigned total, float &x, float &y) const
 
virtual void initParachuteText ()
 
virtual void positionParachuteText ()
 
virtual void onWeaponIndexChanged (int index)
 
virtual void onWeaponStateChanged (int state)
 
virtual void onLauncherIdChanged (DtEntityIdentifier id)
 
virtual void onWeaponListChanged (const DtAttributeHandle &)
 
virtual void onHasWeaponsChanged (bool hasWeapons)
 
virtual void onDeleteAll () override
 
virtual void onReloadTimerChanged (float time)
 
virtual void updateAll () override
 
virtual void setupHealthElements ()
 
virtual void updateHealthElements (bool visible)
 
virtual void setupFatigueElements ()
 
virtual void updateFatigueElements (bool visible)
 
virtual void updateHudElements (bool visible) override
 
virtual void updateVisionOverlays (bool visible)
 
virtual void updateReticle (bool visible)
 
virtual void computeReticleRandomDirection (double deltaTime)
 
virtual void repositionReticleIntoAimingErrorCircle (makVre::DtVector2DD &newReticlePosition, double aimingErrorCircleRadius)
 
virtual bool isReticleInsideAimingErrorCircle (double aimingErrorCircleRadius, makVre::DtVector2DD &reticleTestPosition)
 
virtual void redirectReticleIntoAimingErrorCircle ()
 
virtual void updateGunReticlePosition (makVre::DtVector2DD &newReticlePosition, makVrv::DtQuadProxy *myCrosshairQuad, double dt)
 
virtual void computeAimingError (const makVre::DtVector2DD &newReticlePosition)
 
virtual void updateGunReticles (bool visible)
 
virtual void updateGrenadeReticle (bool visible)
 
virtual void updateMissileLauncher (bool visible=true, bool reset=false)
 
virtual void updateWeaponAmmoCounts ()
 
virtual void updateMissileLauncherAmmoCount (float count)
 
virtual void setupCurrentWeaponQuad (int pos=-1, int total=-1, int state=-1)
 
virtual void updateWindOverlay ()
 
virtual makVre::DtVreMessageResult handleWindUpdate (makVre::DtVreMessage *msg)
 
virtual makVre::DtVreMessageResult handleResourceUpdate (makVre::DtVreMessage *msg)
 
virtual void onViewportChanged () override
 
virtual void resetWeaponQuads ()
 
virtual void resetPostureQuads (makVrv::DtOverlayRenderer *overlay, const std::vector< HudImageConfig > &configs)
 
virtual bool amReticleProvider () const
 
virtual void createQuads (makVrv::DtOverlayRenderer *overlay, const std::vector< HudImageConfig > &configs) override
 
makVrv::DtTextProxy * createAndInitTextProxy (Texts index)
 
- 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 deleteAll ()
 
virtual makVrv::DtOsgChannel * findChannel (const std::string &channelName="Channel 1")
 
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

makVrv::DtQuadProxy * myNVGOverlayQuad
 
makVrv::DtQuadProxy * myCrosshairQuad
 
makVrv::DtQuadProxy * myNVGCrosshairQuad
 
makVrv::DtBoundingBox myCrosshairOriginalBoundingBox
 
makVrv::DtBoundingBox myNVGCrosshairOriginalBoundingBox
 
makVrv::DtQuadProxy * myLauncherQuad
 
makVrv::DtTextProxy * myLauncherAmmoText
 
bool myLauncherHudVisible
 
std::vector< makVrv::DtQuadProxy * > myWeaponIcons
 
std::vector< makVrv::DtTextProxy * > myAmmoTexts
 
std::vector< makVrv::DtTextProxy * > myClipTexts
 
bool myShowAmmoCounts
 
makVrv::DtTextProxy * myAltText
 
makVrv::DtTextProxy * myOxygenText
 
makVrv::DtTextProxy * myWindSpeedText
 
makVrv::DtTextProxy * myWindDirectionText
 
makVrv::DtQuadProxy * myCurrentWeaponIndicator
 
makVrv::DtQuadProxy * myStandingQuad
 
makVrv::DtQuadProxy * myProneQuad
 
makVrv::DtQuadProxy * myCrouchingQuad
 
makVrv::DtQuadProxy * myKneelingQuad
 
makVrv::DtQuadProxy * myDrone
 
makVrv::DtQuadProxy * myDroneViewFrame
 
makVrv::DtTextProxy * myDroneBatteryText
 
makVrv::DtTextProxy * myDroneDistance
 
makVrv::DtTextProxy * myDroneAltitude
 
makVrv::DtTextProxy * myDroneBearing
 
double myCurrentTime
 
double myTimeLastWindSpeedRequested
 
double myDroneBatteryAmount
 
DtVector myWindRequestLocation
 
makVrv::DtTextProxy * myHealthText
 
makVrv::DtQuadProxy * myHealthBar
 
makVrv::DtQuadProxy * myHealthBarBacker
 
float myOriginalHealthBarWidth
 
std::vector< HudValueColorPairmyHealthBarValueColorPairs
 
makVrv::DtTextProxy * myFatigueText
 
makVrv::DtQuadProxy * myFatigueBar
 
makVrv::DtQuadProxy * myFatigueBarBacker
 
float myOriginalFatigueBarWidth
 
makVre::DtVector2DD myCenterOfGuiLocation
 
double myMaxAimingErrorCircleRadius
 
double myReticleSpeed
 
double myMaxAimingError
 
double myReticleDirectionRandomTimerDuration
 
makVre::DtVector2DD myReticleRandomDirection
 
makVre::DtMenuCursormyLocationCursor
 
std::string myCachedLauncherMarking
 
DtWeaponResourceLogicmyWeaponResourceLogic
 
Extent2D myWeaponIconExtent
 
std::vector< makVre::DtVector2DDmyWeaponIconPositions
 
DtAttributeHandleType< std::vector< std::string > > myWeaponList
 
DtAttributeHandleType< DtEntityIdentifier > myLauncherId
 
- 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
 

Member Enumeration Documentation

◆ Textures

Enumeration of texture indices used in the HUD.

Enumerator
NVG_OVERLAY 

Night vision goggles overlay texture.

WEAPON_AIMING_OVERLAY 

Weapon aiming overlay texture.

HEALTH_BAR_BACKER 

Background for health bar.

FATIGUE_BAR_BACKER 

Background for fatigue bar.

STANDING_TEX 

Standing posture indicator texture.

CROUCHING_TEX 

Crouching posture indicator texture.

PRONE_TEX 

Prone posture indicator texture.

KNEELING_TEX 

Kneeling posture indicator texture.

CIVILIAN_STANDING_TEX 

Civilian standing posture indicator texture.

CIVILIAN_CROUCHING_TEX 

Civilian crouching posture indicator texture.

CIVILIAN_PRONE_TEX 

Civilian prone posture indicator texture.

CIVILIAN_KNEELING_TEX 

Civilian kneeling posture indicator texture.

CROSSHAIR 

Standard crosshair texture.

NVG_CROSSHAIR 

Night vision crosshair texture.

CURRENT_WEAPON 

Current weapon indicator texture.

CURRENT_WEAPON_STOWED 

Current weapon stowed indicator texture.

CURRENT_WEAPON_DOWN 

Current weapon down indicator texture.

WEAPON_PROTOTYPE 

Generic weapon prototype texture.

MISSILE_LAUNCHER 

Missile launcher texture.

DRONE_TEX 

Drone indicator texture.

DRONE_VIEW_FRAME 

Drone view frame texture.

FIRST_WEAPON_TEXTURE 

Index of first weapon-specific texture.

TEXTURES_CONFIG_COUNT 

Total number of texture configurations.

◆ ColorQuads

Enumeration of colored quad indices used in the HUD.

Enumerator
HEALTH_BAR 

Health bar colored quad.

FATIGUE_BAR 

Fatigue bar colored quad.

COLOR_QUADS_CONFIG_COUNT 

Total number of colored quad configurations.

◆ Texts

Enumeration of text element indices used in the HUD.

Enumerator
PARACHUTE_WIND_SPEED 

Parachute wind speed text.

PARACHUTE_WIND_DIRECTION 

Parachute wind direction text.

PARACHUTE_OXYGEN_PERCENT 

Parachute oxygen percentage text.

PARACHUTE_ALTITUDE 

Parachute altitude text.

TEXT_HEALTH 

Health value text.

TEXT_FATIGUE 

Fatigue value text.

TEXT_CONFIG_COUNT 

Total number of text configurations.

Constructor & Destructor Documentation

◆ DtHumanHudUpdater()

makVre::DtHumanHudUpdater::DtHumanHudUpdater ( )

Default constructor.

◆ ~DtHumanHudUpdater()

virtual makVre::DtHumanHudUpdater::~DtHumanHudUpdater ( )
overridevirtual

Virtual destructor.

Member Function Documentation

◆ initialize()

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

Initializes the human HUD updater.

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

Reimplemented from makVre::DtHudUpdater.

Reimplemented in makVre::DtHumanVrHudUpdater.

References makVre::DtPlayerComponent::player().

◆ postInitialize()

virtual bool makVre::DtHumanHudUpdater::postInitialize ( )
overridevirtual

Performs post-initialization setup.

Returns
True if post-initialization was successful, false otherwise

Reimplemented from makVre::DtHudUpdater.

Reimplemented in makVre::DtHumanVrHudUpdater.

◆ tick()

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

Updates the HUD elements for the current frame.

Parameters
dtDelta time since the last frame in seconds

Reimplemented from makVre::DtHudUpdater.

Reimplemented in makVre::DtHumanVrHudUpdater.

◆ type()

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

Returns the component type identifier.

Returns
The component type string

Reimplemented from makVre::DtHudUpdater.

Reimplemented in makVre::DtHumanVrHudUpdater.

◆ onStart()

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

Called when this HUD updater is started.

Initializes and shows HUD elements

Implements makVre::DtHudUpdater.

◆ onStop()

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

Called when this HUD updater is stopped.

Hides and cleans up HUD elements

Implements makVre::DtHudUpdater.

◆ loadWeaponIconExtentConfig()

virtual bool makVre::DtHumanHudUpdater::loadWeaponIconExtentConfig ( makVre::DtInitTable & initTable,
std::string tableName )
protectedvirtual

Loads weapon icon extent configuration.

Parameters
initTableInitialization table containing configurations
tableNameName of the table containing extent configuration
Returns
True if loading was successful, false otherwise

Weapon icons extent in range of 0-1 (for use with normalized screen coordinates). All weapon icons should have the same extent.

◆ loadWeaponIconPositionsConfig()

virtual bool makVre::DtHumanHudUpdater::loadWeaponIconPositionsConfig ( makVre::DtInitTable & initTable,
std::string tableName )
protectedvirtual

Loads weapon icon position configuration.

Parameters
initTableInitialization table containing configurations
tableNameName of the table containing position configuration
Returns
True if loading was successful, false otherwise

Placeholder positions for weapon icons, in normalized screen coordinates.

◆ weaponIconPosition()

virtual void makVre::DtHumanHudUpdater::weaponIconPosition ( unsigned i,
unsigned total,
float & x,
float & y ) const
protectedvirtual

Calculates position for a weapon icon.

Parameters
iIndex of the weapon
totalTotal number of weapons
x[out] Calculated x-coordinate
y[out] Calculated y-coordinate

◆ ammoTextPosition()

virtual void makVre::DtHumanHudUpdater::ammoTextPosition ( unsigned i,
unsigned total,
float & x,
float & y ) const
protectedvirtual

Calculates position for an ammo text display.

Parameters
iIndex of the weapon
totalTotal number of weapons
x[out] Calculated x-coordinate
y[out] Calculated y-coordinate

◆ clipTextPosition()

virtual void makVre::DtHumanHudUpdater::clipTextPosition ( unsigned i,
unsigned total,
float & x,
float & y ) const
protectedvirtual

Calculates position for a clip text display.

Parameters
iIndex of the weapon
totalTotal number of weapons
x[out] Calculated x-coordinate
y[out] Calculated y-coordinate

◆ initParachuteText()

virtual void makVre::DtHumanHudUpdater::initParachuteText ( )
protectedvirtual

Initializes parachute-related text elements.

◆ positionParachuteText()

virtual void makVre::DtHumanHudUpdater::positionParachuteText ( )
protectedvirtual

Positions parachute-related text elements on the HUD.

◆ onWeaponIndexChanged()

virtual void makVre::DtHumanHudUpdater::onWeaponIndexChanged ( int index)
protectedvirtual

Handles changes in the current weapon index.

Parameters
indexNew weapon index

Reimplemented in makVre::DtHumanVrHudUpdater.

◆ onWeaponStateChanged()

virtual void makVre::DtHumanHudUpdater::onWeaponStateChanged ( int state)
protectedvirtual

Handles changes in weapon state.

Parameters
stateNew weapon state

Reimplemented in makVre::DtHumanVrHudUpdater.

◆ onLauncherIdChanged()

virtual void makVre::DtHumanHudUpdater::onLauncherIdChanged ( DtEntityIdentifier id)
protectedvirtual

Handles changes in the launcher entity ID.

Parameters
idNew launcher entity identifier

Reimplemented in makVre::DtHumanVrHudUpdater.

◆ onWeaponListChanged()

virtual void makVre::DtHumanHudUpdater::onWeaponListChanged ( const DtAttributeHandle & )
protectedvirtual

Handles changes in the weapon list.

Parameters
weaponsNew list of weapon names

Reimplemented in makVre::DtHumanVrHudUpdater.

◆ onHasWeaponsChanged()

virtual void makVre::DtHumanHudUpdater::onHasWeaponsChanged ( bool hasWeapons)
protectedvirtual

Handles changes in weapon availability.

Parameters
hasWeaponsTrue if weapons are available, false otherwise

◆ onDeleteAll()

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

Called when all HUD elements are being deleted.

Implements makVre::DtHudUpdater.

◆ onReloadTimerChanged()

virtual void makVre::DtHumanHudUpdater::onReloadTimerChanged ( float time)
protectedvirtual

Handles changes in reload timer.

Parameters
timeCurrent reload timer value in seconds

◆ updateAll()

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

Updates all HUD elements.

Refreshes the state and visibility of all HUD elements based on current player state

Reimplemented from makVre::DtHudUpdater.

◆ setupHealthElements()

virtual void makVre::DtHumanHudUpdater::setupHealthElements ( )
protectedvirtual

Sets up health bar and related HUD elements.

Initializes health indicators and their positions

◆ updateHealthElements()

virtual void makVre::DtHumanHudUpdater::updateHealthElements ( bool visible)
protectedvirtual

Updates health-related HUD elements.

Parameters
visibleFlag indicating if the elements should be visible

◆ setupFatigueElements()

virtual void makVre::DtHumanHudUpdater::setupFatigueElements ( )
protectedvirtual

Sets up fatigue bar and related HUD elements.

Initializes fatigue indicators and their positions

◆ updateFatigueElements()

virtual void makVre::DtHumanHudUpdater::updateFatigueElements ( bool visible)
protectedvirtual

Updates fatigue-related HUD elements.

Parameters
visibleFlag indicating if the elements should be visible

◆ updateHudElements()

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

Updates all HUD elements based on visibility.

Parameters
visibleFlag indicating if the reticle is visible

Overrides base class method to update human-specific HUD elements

Implements makVre::DtHudUpdater.

◆ updateVisionOverlays()

virtual void makVre::DtHumanHudUpdater::updateVisionOverlays ( bool visible)
protectedvirtual

Updates vision enhancement overlays like NVG.

Parameters
visibleFlag indicating if the overlays should be visible

◆ updateReticle()

virtual void makVre::DtHumanHudUpdater::updateReticle ( bool visible)
protectedvirtual

Updates the weapon reticle display.

Parameters
visibleFlag indicating if the reticle should be visible

Updates position, size, and visibility of the reticle based on current weapon and state

◆ computeReticleRandomDirection()

virtual void makVre::DtHumanHudUpdater::computeReticleRandomDirection ( double deltaTime)
protectedvirtual

Computes a new random direction for reticle movement.

Parameters
deltaTimeDelta time since the last frame in seconds

Computes a new reticle direction if the random timer expires

◆ repositionReticleIntoAimingErrorCircle()

virtual void makVre::DtHumanHudUpdater::repositionReticleIntoAimingErrorCircle ( makVre::DtVector2DD & newReticlePosition,
double aimingErrorCircleRadius )
protectedvirtual

Repositions reticle to keep it within the aiming error circle.

Parameters
newReticlePositionReference to the reticle position vector to update
aimingErrorCircleRadiusRadius of the aiming error circle

If the reticle's position goes outside the aiming error circle, this function moves the reticle's position back inside the aiming error circle.

◆ isReticleInsideAimingErrorCircle()

virtual bool makVre::DtHumanHudUpdater::isReticleInsideAimingErrorCircle ( double aimingErrorCircleRadius,
makVre::DtVector2DD & reticleTestPosition )
protectedvirtual

Checks if the reticle is inside the aiming error circle.

Parameters
aimingErrorCircleRadiusRadius of the aiming error circle
reticleTestPositionPosition to test
Returns
True if the position is inside the circle, false otherwise

◆ redirectReticleIntoAimingErrorCircle()

virtual void makVre::DtHumanHudUpdater::redirectReticleIntoAimingErrorCircle ( )
protectedvirtual

Computes a new direction for the reticle when it reaches the edge.

When the reticle reaches the edge of the aiming error circle, this function computes a new direction for the reticle to travel

◆ updateGunReticlePosition()

virtual void makVre::DtHumanHudUpdater::updateGunReticlePosition ( makVre::DtVector2DD & newReticlePosition,
makVrv::DtQuadProxy * myCrosshairQuad,
double dt )
protectedvirtual

Updates the position of the gun reticle.

Parameters
newReticlePosition[in,out] The reticle position vector to update
myCrosshairQuadPointer to the crosshair quad
dtDelta time since the last frame in seconds

Updates the position of the gun reticle based on current aiming factors

References myCrosshairQuad.

◆ computeAimingError()

virtual void makVre::DtHumanHudUpdater::computeAimingError ( const makVre::DtVector2DD & newReticlePosition)
protectedvirtual

Computes the aiming error based on current factors.

Parameters
newReticlePositionCurrent position of the reticle

◆ updateGunReticles()

virtual void makVre::DtHumanHudUpdater::updateGunReticles ( bool visible)
protectedvirtual

Updates gun crosshair display.

Parameters
visibleFlag indicating if the crosshair should be visible

◆ updateGrenadeReticle()

virtual void makVre::DtHumanHudUpdater::updateGrenadeReticle ( bool visible)
protectedvirtual

Updates grenade reticle display.

Parameters
visibleFlag indicating if the reticle should be visible

◆ updateMissileLauncher()

virtual void makVre::DtHumanHudUpdater::updateMissileLauncher ( bool visible = true,
bool reset = false )
protectedvirtual

Updates missile launcher display elements.

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

◆ updateWeaponAmmoCounts()

virtual void makVre::DtHumanHudUpdater::updateWeaponAmmoCounts ( )
protectedvirtual

Updates ammunition count displays for all weapons.

◆ updateMissileLauncherAmmoCount()

virtual void makVre::DtHumanHudUpdater::updateMissileLauncherAmmoCount ( float count)
protectedvirtual

Updates missile launcher ammunition count display.

Parameters
countCurrent ammunition count

◆ setupCurrentWeaponQuad()

virtual void makVre::DtHumanHudUpdater::setupCurrentWeaponQuad ( int pos = -1,
int total = -1,
int state = -1 )
protectedvirtual

Sets up the current weapon indicator quad.

Parameters
posPosition index of the current weapon, -1 for default
totalTotal number of weapons, -1 for default
stateCurrent weapon state, -1 for default

◆ updateWindOverlay()

virtual void makVre::DtHumanHudUpdater::updateWindOverlay ( )
protectedvirtual

Updates wind indicator display.

Updates wind indicator displays with current wind direction and speed

◆ handleWindUpdate()

virtual makVre::DtVreMessageResult makVre::DtHumanHudUpdater::handleWindUpdate ( makVre::DtVreMessage * msg)
protectedvirtual

Handles wind update messages.

Parameters
msgPointer to the message being processed
Returns
Message processing result

◆ handleResourceUpdate()

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

Handles resource update messages.

Parameters
msgPointer to the message being processed
Returns
Message processing result

◆ onViewportChanged()

virtual void makVre::DtHumanHudUpdater::onViewportChanged ( )
overrideprotectedvirtual

Handles viewport change events.

Called when the viewport size or properties change to update HUD element positions

Reimplemented from makVre::DtHudUpdater.

◆ resetWeaponQuads()

virtual void makVre::DtHumanHudUpdater::resetWeaponQuads ( )
protectedvirtual

Resets weapon indicator quads.

Resets the state of weapon indicator quads to default

◆ resetPostureQuads()

virtual void makVre::DtHumanHudUpdater::resetPostureQuads ( makVrv::DtOverlayRenderer * overlay,
const std::vector< HudImageConfig > & configs )
protectedvirtual

Resets posture indicator quads.

Parameters
overlayPointer to the overlay renderer
configsVector of image configurations to create quads from

◆ amReticleProvider()

virtual bool makVre::DtHumanHudUpdater::amReticleProvider ( ) const
protectedvirtual

Checks if this updater provides the reticle.

Returns
True if this updater provides the reticle, false otherwise

Reimplemented in makVre::DtHumanVrHudUpdater.

◆ createQuads()

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

Creates quad elements for the HUD.

Parameters
overlayPointer to the overlay renderer
configsVector of image configurations to create quads from

Implements the pure virtual method from base class to create HUD quad elements

Implements makVre::DtHudUpdater.

◆ createAndInitTextProxy()

makVrv::DtTextProxy * makVre::DtHumanHudUpdater::createAndInitTextProxy ( Texts index)
protected

Creates and initializes a text proxy for a specific text element.

Parameters
indexIndex of the text element to create
Returns
Pointer to the created text proxy

Member Data Documentation

◆ myNVGOverlayQuad

makVrv::DtQuadProxy* makVre::DtHumanHudUpdater::myNVGOverlayQuad
protected

Night vision goggles overlay quad.

◆ myCrosshairQuad

makVrv::DtQuadProxy* makVre::DtHumanHudUpdater::myCrosshairQuad
protected

Standard crosshair quad.

Referenced by updateGunReticlePosition().

◆ myNVGCrosshairQuad

makVrv::DtQuadProxy* makVre::DtHumanHudUpdater::myNVGCrosshairQuad
protected

Night vision crosshair quad.

◆ myCrosshairOriginalBoundingBox

makVrv::DtBoundingBox makVre::DtHumanHudUpdater::myCrosshairOriginalBoundingBox
protected

Original bounding box of the standard crosshair.

Saved so that scaling can be done based on the original size

◆ myNVGCrosshairOriginalBoundingBox

makVrv::DtBoundingBox makVre::DtHumanHudUpdater::myNVGCrosshairOriginalBoundingBox
protected

Original bounding box of the NVG crosshair.

Saved so that scaling can be done based on the original size

◆ myLauncherQuad

makVrv::DtQuadProxy* makVre::DtHumanHudUpdater::myLauncherQuad
protected

missile launcher indicator quad

◆ myLauncherAmmoText

makVrv::DtTextProxy* makVre::DtHumanHudUpdater::myLauncherAmmoText
protected

launcher ammunition count text

◆ myLauncherHudVisible

bool makVre::DtHumanHudUpdater::myLauncherHudVisible
protected

Flag indicating if the launcher HUD is visible.

◆ myWeaponIcons

std::vector<makVrv::DtQuadProxy*> makVre::DtHumanHudUpdater::myWeaponIcons
protected

Vector of weapon icon quads.

◆ myAmmoTexts

std::vector<makVrv::DtTextProxy*> makVre::DtHumanHudUpdater::myAmmoTexts
protected

Vector of ammunition count text proxies.

◆ myClipTexts

std::vector<makVrv::DtTextProxy*> makVre::DtHumanHudUpdater::myClipTexts
protected

Vector of clip count text proxies.

◆ myShowAmmoCounts

bool makVre::DtHumanHudUpdater::myShowAmmoCounts
protected

Flag indicating if ammunition counts should be shown.

◆ myAltText

makVrv::DtTextProxy* makVre::DtHumanHudUpdater::myAltText
protected

Altitude text display for parachute mode.

◆ myOxygenText

makVrv::DtTextProxy* makVre::DtHumanHudUpdater::myOxygenText
protected

Oxygen percentage text display for parachute mode.

◆ myWindSpeedText

makVrv::DtTextProxy* makVre::DtHumanHudUpdater::myWindSpeedText
protected

Wind speed text display.

◆ myWindDirectionText

makVrv::DtTextProxy* makVre::DtHumanHudUpdater::myWindDirectionText
protected

Wind direction text display.

◆ myCurrentWeaponIndicator

makVrv::DtQuadProxy* makVre::DtHumanHudUpdater::myCurrentWeaponIndicator
protected

Current weapon indicator quad.

◆ myStandingQuad

makVrv::DtQuadProxy* makVre::DtHumanHudUpdater::myStandingQuad
protected

Standing posture indicator quad.

◆ myProneQuad

makVrv::DtQuadProxy* makVre::DtHumanHudUpdater::myProneQuad
protected

Prone posture indicator quad.

◆ myCrouchingQuad

makVrv::DtQuadProxy* makVre::DtHumanHudUpdater::myCrouchingQuad
protected

Crouching posture indicator quad.

◆ myKneelingQuad

makVrv::DtQuadProxy* makVre::DtHumanHudUpdater::myKneelingQuad
protected

Kneeling posture indicator quad.

◆ myDrone

makVrv::DtQuadProxy* makVre::DtHumanHudUpdater::myDrone
protected

Drone indicator quad.

◆ myDroneViewFrame

makVrv::DtQuadProxy* makVre::DtHumanHudUpdater::myDroneViewFrame
protected

Drone view frame quad.

◆ myDroneBatteryText

makVrv::DtTextProxy* makVre::DtHumanHudUpdater::myDroneBatteryText
protected

Drone battery text display.

◆ myDroneDistance

makVrv::DtTextProxy* makVre::DtHumanHudUpdater::myDroneDistance
protected

Drone distance text display.

◆ myDroneAltitude

makVrv::DtTextProxy* makVre::DtHumanHudUpdater::myDroneAltitude
protected

Drone altitude text display.

◆ myDroneBearing

makVrv::DtTextProxy* makVre::DtHumanHudUpdater::myDroneBearing
protected

Drone bearing text display.

◆ myCurrentTime

double makVre::DtHumanHudUpdater::myCurrentTime
protected

Current time in seconds.

◆ myTimeLastWindSpeedRequested

double makVre::DtHumanHudUpdater::myTimeLastWindSpeedRequested
protected

Time of last wind speed request in seconds.

◆ myDroneBatteryAmount

double makVre::DtHumanHudUpdater::myDroneBatteryAmount
protected

Drone battery amount.

◆ myWindRequestLocation

DtVector makVre::DtHumanHudUpdater::myWindRequestLocation
protected

Location of last wind request.

◆ myHealthText

makVrv::DtTextProxy* makVre::DtHumanHudUpdater::myHealthText
protected

Health status gui related variables.

Health value text display

◆ myHealthBar

makVrv::DtQuadProxy* makVre::DtHumanHudUpdater::myHealthBar
protected

Health bar colored quad.

◆ myHealthBarBacker

makVrv::DtQuadProxy* makVre::DtHumanHudUpdater::myHealthBarBacker
protected

Health bar background quad.

◆ myOriginalHealthBarWidth

float makVre::DtHumanHudUpdater::myOriginalHealthBarWidth
protected

Original width of the health bar.

◆ myHealthBarValueColorPairs

std::vector<HudValueColorPair> makVre::DtHumanHudUpdater::myHealthBarValueColorPairs
protected

Vector of health bar value-color pairs.

◆ myFatigueText

makVrv::DtTextProxy* makVre::DtHumanHudUpdater::myFatigueText
protected

Fatigue status gui related variables.

Fatigue value text display

◆ myFatigueBar

makVrv::DtQuadProxy* makVre::DtHumanHudUpdater::myFatigueBar
protected

Fatigue bar colored quad.

◆ myFatigueBarBacker

makVrv::DtQuadProxy* makVre::DtHumanHudUpdater::myFatigueBarBacker
protected

Fatigue bar background quad.

◆ myOriginalFatigueBarWidth

float makVre::DtHumanHudUpdater::myOriginalFatigueBarWidth
protected

Original width of the fatigue bar.

◆ myCenterOfGuiLocation

makVre::DtVector2DD makVre::DtHumanHudUpdater::myCenterOfGuiLocation
protected

Reticle gui related variables.

Center of the GUI in normalized screen coordinates

◆ myMaxAimingErrorCircleRadius

double makVre::DtHumanHudUpdater::myMaxAimingErrorCircleRadius
protected

Maximum aiming error circle radius in pixels.

◆ myReticleSpeed

double makVre::DtHumanHudUpdater::myReticleSpeed
protected

Reticle speed in pixels per second.

◆ myMaxAimingError

double makVre::DtHumanHudUpdater::myMaxAimingError
protected

Maximum aiming error in radians.

◆ myReticleDirectionRandomTimerDuration

double makVre::DtHumanHudUpdater::myReticleDirectionRandomTimerDuration
protected

Timer for random reticle position updates in seconds.

◆ myReticleRandomDirection

makVre::DtVector2DD makVre::DtHumanHudUpdater::myReticleRandomDirection
protected

Current reticle position in normalized screen coordinates.

Range is -0.5 to 0.5, where (0,0) is the center of the screen

◆ myLocationCursor

makVre::DtMenuCursor* makVre::DtHumanHudUpdater::myLocationCursor
protected

◆ myCachedLauncherMarking

std::string makVre::DtHumanHudUpdater::myCachedLauncherMarking
protected

Cached launcher marking.

◆ myWeaponResourceLogic

DtWeaponResourceLogic* makVre::DtHumanHudUpdater::myWeaponResourceLogic
protected

Pointer to the weapon resource logic.

◆ myWeaponIconExtent

Extent2D makVre::DtHumanHudUpdater::myWeaponIconExtent
protected

Extent of weapon icons in normalized screen coordinates.

◆ myWeaponIconPositions

std::vector<makVre::DtVector2DD> makVre::DtHumanHudUpdater::myWeaponIconPositions
protected

Vector of weapon icon positions in normalized screen coordinates.

◆ myWeaponList

DtAttributeHandleType<std::vector<std::string> > makVre::DtHumanHudUpdater::myWeaponList
protected

◆ myLauncherId

DtAttributeHandleType<DtEntityIdentifier> makVre::DtHumanHudUpdater::myLauncherId
protected

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