SuperDex Physics C++ API
Loading...
Searching...
No Matches
superdex::AsyncStepParams Struct Reference

Parameters controlling the stepping behavior of an AsyncScene. More...

#include <mochi_structs.h>

Public Attributes

double dynamicTimeStepMaxSeconds = 0.01
 Maximum time step size [s] in dynamic mode.
double dynamicTimeStepMinSeconds = 0.001
 Minimum time step size [s] in dynamic mode.
double fixedTimeStepSeconds = 0.01
 Fixed time step size [s].
std::function< double()> timeStepCallback
 Optional callback to provide custom time step size [s].
bool useFixedTimeStep = false
 Use fixed time step if true, dynamic (real-time) time step if false.

Detailed Description

Parameters controlling the stepping behavior of an AsyncScene.

Configures how an AsyncScene determines the time step size. There are three modes for determining the time step size, evaluated in the following priority order:

  1. If timeStepCallback is set and returns a non-negative value, use the callback value.
  2. Else if useFixedTimeStep is true, use fixedTimeStepSeconds.
  3. Else, use elapsed real time since the last step (dynamic mode).
See also
AsyncScene::GetAsyncStepParams, AsyncScene::SetAsyncStepParams

Definition at line 485 of file mochi_structs.h.

Member Data Documentation

◆ dynamicTimeStepMaxSeconds

double superdex::AsyncStepParams::dynamicTimeStepMaxSeconds = 0.01

Maximum time step size [s] in dynamic mode.

Note
Dynamic mode is only used when useFixedTimeStep is false and timeStepCallback either is not set or returns a negative value.
Must be finite. Negative values are clamped to zero.

Definition at line 492 of file mochi_structs.h.

◆ dynamicTimeStepMinSeconds

double superdex::AsyncStepParams::dynamicTimeStepMinSeconds = 0.001

Minimum time step size [s] in dynamic mode.

Note
Dynamic mode is only used when useFixedTimeStep is false and timeStepCallback either is not set or returns a negative value.
Must be finite. Negative values are clamped to zero. Values greater than dynamicTimeStepMaxSeconds are clamped down to that maximum.

Definition at line 490 of file mochi_structs.h.

◆ fixedTimeStepSeconds

double superdex::AsyncStepParams::fixedTimeStepSeconds = 0.01

Fixed time step size [s].

Note
Must be finite and non-negative.
Used when useFixedTimeStep is true and timeStepCallback is not set or returns a negative value.
Also used by AsyncScene::RequestStepThenPause when timeStepCallback is not set or returns a negative value, even if dynamic-time-step mode is configured.
See also
AsyncScene::RequestStepThenPause, AsyncStepParams::useFixedTimeStep, AsyncStepParams::timeStepCallback

Definition at line 488 of file mochi_structs.h.

◆ timeStepCallback

std::function<double()> superdex::AsyncStepParams::timeStepCallback

Optional callback to provide custom time step size [s].

Note
Called on the simulation thread before each step.
If set and it returns a non-negative value, overrides both fixed and dynamic modes.
If it returns a negative value, the async scene falls back to the configured fixed or dynamic time-step behavior.
See also
AsyncStepParams::fixedTimeStepSeconds, AsyncStepParams::useFixedTimeStep

Definition at line 494 of file mochi_structs.h.

◆ useFixedTimeStep

bool superdex::AsyncStepParams::useFixedTimeStep = false

Use fixed time step if true, dynamic (real-time) time step if false.

Note
"Dynamic" means the time step equals elapsed wall-clock time since the last step.
Ignored if timeStepCallback is set and returns a non-negative value.
See also
AsyncStepParams::fixedTimeStepSeconds, AsyncStepParams::timeStepCallback

Definition at line 486 of file mochi_structs.h.


The documentation for this struct was generated from the following files: