Physics engine related classes and functions
Experimental API:
The physics submodule is an experimental and new API that is highly susceptible to breaking changes in the future.
set_fixed_delta(fixed_delta: float) → Noneset_fixed_delta(fixed_delta: float) → NoneSet the fixed delta time for automatic physics stepping. Default is 1/60 seconds (60 FPS).
Setting this to a value greater than 0.0 enables automatic physics stepping in the engine backend. The physics will be updated with this fixed time step, using an accumulator to handle variable frame rates.
Args
fixed_delta : The fixed time step in seconds (e.g., 1.0/60.0).
Set to 0.0 to disable automatic stepping.get_fixed_delta() → floatget_fixed_delta() → floatGet the current fixed delta time for physics stepping.
Returns
float : The fixed time step in seconds.
set_max_substeps(max_substeps: int) → Noneset_max_substeps(max_substeps: int) → NoneSet the maximum number of substeps for physics stepping. Default is 4.
Args
max_substeps : The number of substeps per time step.get_max_substeps() → intget_max_substeps() → intGet the current maximum number of substeps for physics stepping.
Returns
int : The number of substeps per time step.