Physics
Physics engine related classes and functions
Experimental API:
The physics submodule is a VERY experimental and new API that is highly susceptible to breaking changes in the future.
Get Fixed Delta
get_fixed_delta() → floatGet the current fixed delta time for physics stepping.
Returns
float : The fixed time step in seconds.
Get Max Substeps
get_max_substeps() → intGet the current maximum number of substeps for physics stepping.
Returns
int : The number of substeps per time step.
Set Fixed Delta
set_fixed_delta(fixed_delta: SupportsFloat) → 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.
Set Max Substeps
set_max_substeps(max_substeps: SupportsInt) → NoneSet the maximum number of substeps for physics stepping.
Args
max_substeps: The number of substeps per time step.