VR-Engage  2.2
Loading...
Searching...
No Matches
vreRtd::DtVreRtdTickCallback Class Reference

Detailed Description

This singleton class manages the periodic updating of RTD simulation states during each simulation frame. It synchronizes the time between the RTD and VRF systems, and handles environmental updates such as wind conditions.

#include <vreRtdTickCallback.h>

Public Member Functions

 DtVreRtdTickCallback ()
 
void updateWind ()
 

Static Public Member Functions

static void callback (void *usr)
 
static DtVreRtdTickCallbackgetInstance ()
 

Public Attributes

smReal myFrameTimestamp
 
double myCurWindDir
 
double myCurWindSpeed
 

Static Public Attributes

static DtVreRtdTickCallbacktheInstance
 

Constructor & Destructor Documentation

◆ DtVreRtdTickCallback()

vreRtd::DtVreRtdTickCallback::DtVreRtdTickCallback ( )
inline

Default constructor.

Initializes a new tick callback handler with default values.

References myCurWindDir, myCurWindSpeed, and myFrameTimestamp.

Referenced by callback(), and getInstance().

Member Function Documentation

◆ callback()

static void vreRtd::DtVreRtdTickCallback::callback ( void * usr)
inlinestatic

Static callback function for frame ticks.

Parameters
usrUser data pointer (points to the tick callback instance)

Called once per simulation frame to update the RTD world. This function synchronizes the RTD simulation time with the VRF exercise time and performs one or more RTD world updates as needed to keep the systems in sync.

References DtVreRtdTickCallback(), vreRtd::DtVreRtdGlobal::getInstance(), vreRtd::DtVreRtdGlobal::rtdWorld(), and updateWind().

◆ getInstance()

static DtVreRtdTickCallback * vreRtd::DtVreRtdTickCallback::getInstance ( )
inlinestatic

Gets the singleton instance of the tick callback handler.

Returns
Pointer to the singleton instance

Returns the singleton instance of the tick callback handler, creating it if it doesn't already exist. This is the proper way to access the tick callback handler.

References DtVreRtdTickCallback(), and theInstance.

◆ updateWind()

void vreRtd::DtVreRtdTickCallback::updateWind ( )

Updates the current wind conditions.

Updates the current wind direction and speed from the environment. This is called once per frame during the tick callback.

Referenced by callback().

Member Data Documentation

◆ theInstance

DtVreRtdTickCallback* vreRtd::DtVreRtdTickCallback::theInstance
static

Singleton instance of the tick callback handler.

Referenced by getInstance().

◆ myFrameTimestamp

smReal vreRtd::DtVreRtdTickCallback::myFrameTimestamp

Timestamp of the current frame.

Stores the timestamp of the current frame for time synchronization.

Referenced by DtVreRtdTickCallback().

◆ myCurWindDir

double vreRtd::DtVreRtdTickCallback::myCurWindDir

Current wind direction in radians.

Referenced by DtVreRtdTickCallback().

◆ myCurWindSpeed

double vreRtd::DtVreRtdTickCallback::myCurWindSpeed

Current wind speed in meters per second.

Referenced by DtVreRtdTickCallback().


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