Kraken Logo

Kraken Engine

DocumentationGuidesShowcaseCommunity
Ctrl
K
Navigating the Docs
Building Docs
Overview
Camera
Color
Draw
Ease
Event
Fx
Gamepad
Input
Log
Math
Mixer
Mouse
Physics
Pixel Array
Renderer
Shaders
Time
Transform
Ui
Viewport
Window

Built bydurkisneer1.Kraken Engine is open source and available onGitHub.

  1. Docs
  2. Functions
  3. Physics

Physics

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

set_fixed_delta(fixed_delta: float) → Noneset_fixed_delta(fixed_delta: float) → None

Set 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

get_fixed_delta() → floatget_fixed_delta() → float

Get the current fixed delta time for physics stepping.

Returns

float : The fixed time step in seconds.

Set Max Substeps

set_max_substeps(max_substeps: int) → Noneset_max_substeps(max_substeps: int) → None

Set the maximum number of substeps for physics stepping. Default is 4.

Args

  • max_substeps : The number of substeps per time step.

Get Max Substeps

get_max_substeps() → intget_max_substeps() → int

Get the current maximum number of substeps for physics stepping.

Returns

int : The number of substeps per time step.

PreviousMouse
NextPixel Array

On this page

Set Fixed DeltaGet Fixed DeltaSet Max SubstepsGet Max Substeps