Nudge Physics
A single file, header-only 3D physics library
Loading...
Searching...
No Matches
nudge::SimulationParams Struct Reference

The SimulationParams struct. More...

#include <nudge.h>

Public Attributes

double time_step
 
unsigned max_num_substeps
 
unsigned num_iterations_per_substep
 
float sleeping_threshold_linear_velocity_squared
 
float sleeping_threshold_angular_velocity_squared
 
float linear_damping
 
float angular_damping
 
float penetration_allowed_amount
 
float penetration_bias_factor
 
unsigned numsubsteps_overflow_warning_mode
 
unsigned long long num_frames
 
unsigned long long num_total_substeps
 
double remaining_time_in_seconds
 
float time_step_minus_remaining_time
 
unsigned num_substeps_in_last_frame
 
unsigned numsubsteps_overflow_in_last_frame
 

Detailed Description

The SimulationParams struct.

Note
It's used to tweak the simulation

Member Data Documentation

◆ time_step

double nudge::SimulationParams::time_step

[tweakable] [default value 1.0/60.0]

◆ max_num_substeps

unsigned nudge::SimulationParams::max_num_substeps

[tweakable] [default value 2] when too much time passes, only max_num_substeps are performed, and the simulation 'burns' the remaining substeps

◆ num_iterations_per_substep

unsigned nudge::SimulationParams::num_iterations_per_substep

[tweakable] [default value 5] it improves some stability at the expense of performance

◆ sleeping_threshold_linear_velocity_squared

float nudge::SimulationParams::sleeping_threshold_linear_velocity_squared

[tweakable] [default value 1e-2f]; by increasing it the bodies goes to sleep faster

◆ sleeping_threshold_angular_velocity_squared

float nudge::SimulationParams::sleeping_threshold_angular_velocity_squared

[tweakable] [default value 1e-1f]; by increasing it the bodies goes to sleep faster

◆ linear_damping

float nudge::SimulationParams::linear_damping

[tweakable] [default value 0.25]; by increasing it, the bodies slow down their movement faster

◆ angular_damping

float nudge::SimulationParams::angular_damping

[tweakable] [default value 0.25]; by increasing it, the bodies slow down their rotation faster

◆ penetration_allowed_amount

float nudge::SimulationParams::penetration_allowed_amount

[tweakable(?)] [default value 1e-3f];

◆ penetration_bias_factor

float nudge::SimulationParams::penetration_bias_factor

[tweakable(?)] [default value 2.0f];

◆ numsubsteps_overflow_warning_mode

unsigned nudge::SimulationParams::numsubsteps_overflow_warning_mode

[tweakable] nudge::log warns on every frame with a numsubstep overflown. Modes: 0:warn on second successive frame;1:warn always;2:never warn. Default is 0

◆ num_frames

unsigned long long nudge::SimulationParams::num_frames

[read-only] number of physic frames, i.e. the total number of calls to simulation_step(...) with at least one substep to perform. Usually in each graphic frame there is a single call to simulation_step and the number of physic frames can increase by one unit or remain constant (TODO: consider removing this, and renaming num_frames the num_total_substeps)

◆ num_total_substeps

unsigned long long nudge::SimulationParams::num_total_substeps

[read-only] the total number of physic substeps so far. In one physic frame there can be a number of substeps in the interval [0,max_num_substeps]; good value for benchmark measures

◆ remaining_time_in_seconds

double nudge::SimulationParams::remaining_time_in_seconds

[used internally]

◆ time_step_minus_remaining_time

float nudge::SimulationParams::time_step_minus_remaining_time

[used intenally]

◆ num_substeps_in_last_frame

unsigned nudge::SimulationParams::num_substeps_in_last_frame

[read-only] returned by pre_simulation_step(...); it's <= max_num_substeps, and it equals the number of substeps that next call to simulation_step will perform

◆ numsubsteps_overflow_in_last_frame

unsigned nudge::SimulationParams::numsubsteps_overflow_in_last_frame

[read-only] set in simulation_step


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