|
VR-Engage
2.3
|
DtHumanVrHudUpdater extends the standard human HUD updater with VR-specific functionality, managing specialized rendering of HUD elements for VR displays. It handles positioning, visibility, and updates of HUD elements based on the player state in VR mode, including weapon indicators and reticles.
#include <humanVrHudUpdater.h>
Public Member Functions | |
| DtHumanVrHudUpdater () | |
| virtual | ~DtHumanVrHudUpdater () override |
| virtual bool | initialize (makVre::DtPlayerStation *player, makVre::DtInitTable &config) override |
| virtual bool | postInitialize () override |
| virtual void | tick (double dt) override |
| virtual void | shutdown () override |
| virtual const char * | type () const override |
Public Member Functions inherited from makVre::DtHumanHudUpdater | |
| DtHumanHudUpdater () | |
| virtual | ~DtHumanHudUpdater () override |
Public Member Functions inherited from makVre::DtHudUpdater | |
| DtHudUpdater () | |
| virtual | ~DtHudUpdater () 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 () |
| bool | componentReady () const |
| void | setComponentReady (bool ready) |
| virtual DtInitTickStatus | finalizeInitTick (double dt) |
| virtual void | setName (const std::string &name) |
| virtual const std::string & | name () |
| virtual DtPlayerStation & | player () |
| virtual DtAttributeHandle & | playerAttributeStore () |
| virtual const DtAttributeHandle & | playerAttributeStore () const |
| virtual const DtAttributeHandle & | ownshipState () const |
| virtual void | setExtendedData (const std::string &key, const std::string &value, DtEntityIdentifier entity=DtEntityIdentifier::nullId()) |
Protected Member Functions | |
| virtual makVrv::DtOsgChannel * | findChannel (const std::string &channelName="") override |
| virtual void | deleteAll () override |
| virtual bool | amReticleProvider () const override |
| void | updateGunReticle (bool visible, double dt) |
| void | onVrStateChanged (bool enabled) |
| virtual void | onWeaponIndexChanged (int index) override |
| virtual void | onWeaponStateChanged (int state) override |
| virtual void | onLauncherIdChanged (DtEntityIdentifier id) override |
| virtual void | onWeaponListChanged (const DtAttributeHandle &) override |
| virtual void | onPostureChanged (HumanPosture posture) |
| virtual void | delayFade (float *fader, float val) |
| virtual void | applyFade (makVrv::DtQuadProxy *quad, float val) |
| virtual void | applyFade (makVrv::DtTextProxy *text, float val) |
Protected Member Functions inherited from makVre::DtHumanHudUpdater | |
| 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 | onHasWeaponsChanged (bool hasWeapons) |
| virtual void | onDeleteAll () override |
| virtual void | onReloadTimerChanged (double 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 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 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 () |
Additional Inherited Members | |
Protected Types inherited from makVre::DtHumanHudUpdater | |
| 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 } |
| makVre::DtHumanVrHudUpdater::DtHumanVrHudUpdater | ( | ) |
Default constructor.
|
overridevirtual |
Virtual destructor.
|
overridevirtual |
Initializes the VR HUD updater component.
| player | Pointer to the player station |
| config | Configuration settings for initialization |
Reimplemented from makVre::DtHumanHudUpdater.
References makVre::DtPlayerComponent::player().
|
overridevirtual |
Performs post-initialization setup.
Reimplemented from makVre::DtHumanHudUpdater.
|
overridevirtual |
Updates the VR HUD elements for the current frame.
| dt | Delta time since the last frame in seconds |
Reimplemented from makVre::DtHumanHudUpdater.
|
overridevirtual |
Cleans up resources when the component is being shut down.
Reimplemented from makVre::DtHudUpdater.
|
overridevirtual |
Returns the component type identifier.
Reimplemented from makVre::DtHumanHudUpdater.
|
overrideprotectedvirtual |
Finds an OSG channel by name.
| channelName | Name of the channel to find, empty for default channel |
Reimplemented from makVre::DtHudUpdater.
|
overrideprotectedvirtual |
Deletes all HUD elements.
Reimplemented from makVre::DtHudUpdater.
|
overrideprotectedvirtual |
Checks if this updater provides the reticle.
Reimplemented from makVre::DtHumanHudUpdater.
|
protected |
Updates the gun reticle in VR mode.
| visible | Flag indicating if the reticle should be visible |
| dt | Delta time since the last frame in seconds |
Updates position, size, and visibility of the gun reticle for VR
|
protected |
Handles changes in VR state.
| enabled | True if VR is enabled, false otherwise |
|
overrideprotectedvirtual |
Handles changes in the current weapon index.
| index | New weapon index |
Reimplemented from makVre::DtHumanHudUpdater.
|
overrideprotectedvirtual |
Handles changes in weapon state.
| state | New weapon state |
Reimplemented from makVre::DtHumanHudUpdater.
|
overrideprotectedvirtual |
Handles changes in the launcher entity ID.
| id | New launcher entity identifier |
Reimplemented from makVre::DtHumanHudUpdater.
|
overrideprotectedvirtual |
Handles changes in the weapon list.
| weapons | New list of weapon names |
Reimplemented from makVre::DtHumanHudUpdater.
|
protectedvirtual |
Handles changes in player posture.
| posture | New player posture |
|
protectedvirtual |
Applies a delayed fade effect to a fader value.
| fader | Pointer to the fader value to update |
| val | Target fade value |
|
protectedvirtual |
Applies a fade effect to a quad proxy.
| quad | Pointer to the quad proxy to fade |
| val | Fade value to apply |
|
protectedvirtual |
Applies a fade effect to a text proxy.
| text | Pointer to the text proxy to fade |
| val | Fade value to apply |
|
protected |
Current fade value for weapon indicators.
|
protected |
Current fade value for posture indicators.
|
protected |
VR-specific aim point cursor.