VR-Engage  2.3
Loading...
Searching...
No Matches
DtHumanAudioUpdater Class Reference

Detailed Description

DtHumanAudioUpdater handles the audio effects related to the human entity, such as parachute sounds, weapon reload sounds, and environment soundscapes. It controls the timing and volume of audio cues based on player state and actions.

#include <humanAudioUpdater.h>

Inheritance diagram for DtHumanAudioUpdater:
[legend]

Public Member Functions

 DtHumanAudioUpdater ()
 
virtual ~DtHumanAudioUpdater () override
 
virtual bool initialize (makVre::DtPlayerStation *player, makVre::DtInitTable &config) override
 
virtual void tick (double dt) override
 
virtual void shutdown () override
 
virtual const char * type () const override
 
virtual void onReloadTimerChanged (double reloadTimer)
 
- Public Member Functions inherited from makVre::DtPlayerComponent
 DtPlayerComponent ()
 
virtual ~DtPlayerComponent ()
 
virtual bool postInitialize ()
 
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 Attributes

makAudio::DtSound * myParachuteFreefallSound
 
makAudio::DtSound * myParachuteOpenSound
 
makAudio::DtSound * myParachuteInteriorSound
 
makAudio::DtSound * myReloadSound
 
bool myReloadInProgress
 
double myReloadSoundDelay
 
double myReloadSoundTimer
 
double myFreefallNormalSpeed
 
double myFreefallNormalVolume
 
makVre::DtSoundscape * mySoundscape
 
double mySoundscapeVolume
 
makVre::HumanPosture myCachedPosture
 
makVre::DtAttributeHandleType< makVre::HumanPosture > myPostureAttr
 
makVre::DtAttributeHandleType< DtVector32 > myVelocityAttr
 
makVre::DtAttributeHandleType< bool > myEmbarkedOnAircraftAttr
 
makVre::DtAttributeHandleType< DtVector > myPositionAttr
 
- Protected Attributes inherited from makVre::DtPlayerComponent
bool myComponentReady = true
 
std::string myName
 
DtInitTable myConfig
 
DtPlayerStation * myPlayer
 
makVrv::DtDe * myDe
 
DtEntityResolver * myResolver
 
DtAttributeCallbackManager myAttributeCallbacks
 
DtVreMessageHandlerGroup myMessageHandlers
 

Additional Inherited Members

- Protected Member Functions inherited from makVre::DtPlayerComponent
virtual void initializeStateAttributes ()
 

Constructor & Destructor Documentation

◆ DtHumanAudioUpdater()

DtHumanAudioUpdater::DtHumanAudioUpdater ( )

Default constructor.

◆ ~DtHumanAudioUpdater()

virtual DtHumanAudioUpdater::~DtHumanAudioUpdater ( )
overridevirtual

Virtual destructor.

Member Function Documentation

◆ initialize()

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

Initializes the audio updater.

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

Reimplemented from makVre::DtPlayerComponent.

References makVre::DtPlayerComponent::player().

◆ tick()

virtual void DtHumanAudioUpdater::tick ( double dt)
overridevirtual

Updates audio effects for the current frame.

Parameters
dtDelta time since the last frame in seconds

Implements makVre::DtPlayerComponent.

◆ shutdown()

virtual void DtHumanAudioUpdater::shutdown ( )
overridevirtual

Cleans up resources when the component is being shut down.

Reimplemented from makVre::DtPlayerComponent.

◆ type()

virtual const char * DtHumanAudioUpdater::type ( ) const
overridevirtual

Returns the component type identifier.

Returns
String identifier for this component type

Returns the type identifier string for this component, which is used by the VR-Engage framework for component identification and management. The returned value matches DtHumanAudioUpdaterType.

Implements makVre::DtPlayerComponent.

◆ onReloadTimerChanged()

virtual void DtHumanAudioUpdater::onReloadTimerChanged ( double reloadTimer)
virtual

Handles changes in the weapon reload timer.

Parameters
reloadTimerCurrent value of the reload timer in seconds

Schedules the reload sound when a reload starts.

Member Data Documentation

◆ myParachuteFreefallSound

makAudio::DtSound* DtHumanAudioUpdater::myParachuteFreefallSound
protected

Sound played during parachute freefall.

◆ myParachuteOpenSound

makAudio::DtSound* DtHumanAudioUpdater::myParachuteOpenSound
protected

Sound played when parachute opens.

◆ myParachuteInteriorSound

makAudio::DtSound* DtHumanAudioUpdater::myParachuteInteriorSound
protected

Sound played when inside an open parachute.

◆ myReloadSound

makAudio::DtSound* DtHumanAudioUpdater::myReloadSound
protected

Sound played shortly after a weapon reload starts.

◆ myReloadInProgress

bool DtHumanAudioUpdater::myReloadInProgress
protected

Whether a weapon reload is currently in progress.

◆ myReloadSoundDelay

double DtHumanAudioUpdater::myReloadSoundDelay
protected

Delay before playing the reload sound, in seconds.

◆ myReloadSoundTimer

double DtHumanAudioUpdater::myReloadSoundTimer
protected

Remaining delay before the pending reload sound plays, in seconds.

◆ myFreefallNormalSpeed

double DtHumanAudioUpdater::myFreefallNormalSpeed
protected

Normal speed for freefall sound playback.

◆ myFreefallNormalVolume

double DtHumanAudioUpdater::myFreefallNormalVolume
protected

Normal volume for freefall sound.

◆ mySoundscape

makVre::DtSoundscape* DtHumanAudioUpdater::mySoundscape
protected

Current environmental soundscape.

◆ mySoundscapeVolume

double DtHumanAudioUpdater::mySoundscapeVolume
protected

Volume of the current soundscape.

◆ myCachedPosture

makVre::HumanPosture DtHumanAudioUpdater::myCachedPosture
protected

Cached posture of the human entity.

Stored here so the open parachute sound can be triggered at the right time.

◆ myPostureAttr

makVre::DtAttributeHandleType<makVre::HumanPosture> DtHumanAudioUpdater::myPostureAttr
protected

Handle for current human posture.

Attribute Store Keyposture

◆ myVelocityAttr

makVre::DtAttributeHandleType<DtVector32> DtHumanAudioUpdater::myVelocityAttr
protected

Handle for ownship velocity.

Attribute Store Keyownship.velocity

◆ myEmbarkedOnAircraftAttr

makVre::DtAttributeHandleType<bool> DtHumanAudioUpdater::myEmbarkedOnAircraftAttr
protected

Handle indicating whether ownship is embarked on an aircraft.

Attribute Store Keyownship.embarked.embarkedOnAircraft

◆ myPositionAttr

makVre::DtAttributeHandleType<DtVector> DtHumanAudioUpdater::myPositionAttr
protected

Handle for ownship position.

Attribute Store Keyownship.position

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