Kimbatt / unity-deterministic-physics

Cross-platform deterministic physics simulation in Unity, using DOTS physics and soft floats
497 stars 64 forks source link
deterministic physics physics-engine physics-simulation unity unity3d

Unity deterministic physics

This is a modified version of Unity DOTS Physics version 0.6.0-preview.3, which supports cross-platform deterministic physics simulation by using soft floats.

Usage

The following packages must be installed:

You'll need to use the UnityS.Physics and the UnityS.Mathematics namespaces instead of the usual Unity.Physics and Unity.Mathematics.

See Unity Physics manual for documentation.

Notes on determinism

For a deterministic physics simulation:

Example

See the ExampleScene scene for an example. After running it, your simulation should look exactly like this:

License

Unity.Physics, Unity.Mathematics, and Unity.Transforms are licensed under the Unity Companion License.

Soft floats is licensed under the MIT License. See https://github.com/Kimbatt/soft-float-starter-pack for more information.