DubiousEngine
0.2.0
Simple Game Engine
|
Constraint solver settings. More...
#include <Arena.h>
Public Attributes | |
float | step_size = 0.0166666f |
int | iterations = 20 |
float | beta = 0.03f |
float | coefficient_of_restitution = 0.5f |
float | slop = 0.05f |
Constraint solver settings.
Settings for the constraint solver
float Dubious::Physics::Arena::Constraint_solver_settings::beta = 0.03f |
Beta affects how much force is applied when objects are overlapping. The further the overlap, the more separating force is applied. If this is set too low, objects can overlap and never push apart. Set it too high and resting objects will jitter.
float Dubious::Physics::Arena::Constraint_solver_settings::coefficient_of_restitution = 0.5f |
This fake force is applied proportionally to how fast objects are overlapping. This can help stop fast objects from penetrating too far. However if it's turned up too high it will cause bouncing.
int Dubious::Physics::Arena::Constraint_solver_settings::iterations = 20 |
How many iterations the constraint solver will take per time step.
float Dubious::Physics::Arena::Constraint_solver_settings::slop = 0.05f |
This affects both beta and the coefficient of restitution. If objects are overlapping less then this, then neither of those forces will be applied. A little bit of slop will allow some penetration, but a stabler system. Not enough slop and things will become unstable.
float Dubious::Physics::Arena::Constraint_solver_settings::step_size = 0.0166666f |
How long, in seconds, for an individual time step. The engine will always perform physics updates in discrete units of this much time. 1/60th is a good number