Nudge Physics
A single file, header-only 3D physics library
|
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 |
The SimulationParams struct.
double nudge::SimulationParams::time_step |
[tweakable] [default value 1.0/60.0]
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
unsigned nudge::SimulationParams::num_iterations_per_substep |
[tweakable] [default value 5] it improves some stability at the expense of performance
float nudge::SimulationParams::sleeping_threshold_linear_velocity_squared |
[tweakable] [default value 1e-2f]; by increasing it the bodies goes to sleep faster
float nudge::SimulationParams::sleeping_threshold_angular_velocity_squared |
[tweakable] [default value 1e-1f]; by increasing it the bodies goes to sleep faster
float nudge::SimulationParams::linear_damping |
[tweakable] [default value 0.25]; by increasing it, the bodies slow down their movement faster
float nudge::SimulationParams::angular_damping |
[tweakable] [default value 0.25]; by increasing it, the bodies slow down their rotation faster
float nudge::SimulationParams::penetration_allowed_amount |
[tweakable(?)] [default value 1e-3f];
float nudge::SimulationParams::penetration_bias_factor |
[tweakable(?)] [default value 2.0f];
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
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)
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
double nudge::SimulationParams::remaining_time_in_seconds |
[used internally]
float nudge::SimulationParams::time_step_minus_remaining_time |
[used intenally]
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
unsigned nudge::SimulationParams::numsubsteps_overflow_in_last_frame |
[read-only] set in simulation_step