Skip to content

Commit

Permalink
Update determinism.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Ughuuu committed Aug 30, 2024
1 parent e5c2c20 commit d18401f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions docs/documentation/determinism.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,21 @@ Determinism means that if the inputs of the system and the outputs of the system

In order to re-run a deterministic simulation, you have to have exactly the same input conditions. It's not enough to set the positions or velocities of the objects to where the objects were intially (it might look like the world inputs are the objects positions, but there are more hidden inputs too. In order to see the state of the world, use serialization functions on the space). In order to have the exact same conditions, you can reload the scene using `get_tree().reload_current_scene()`

## Manual stepping

Rapier exposes 2 functions for manual stepping:

- `RapierPhysicsServer2/3D.space_step(space, delta)`
- `RapierPhysicsServer2/3D.space_flush_queries(space)`

Also, if you don't want the physics space to auto step, you can use:

- `PhysicsServer2/3D.space_set_active(space, false)`

In order to get the current space rid, use:

- `get_viewport().world_2/3d.space`

## Components

The Godot Rapier addon interacts with the following:
Expand Down

0 comments on commit d18401f

Please sign in to comment.