Skip to content
프로젝트

Kimbatt/unity-deterministic-physics

GitHub에서 보기

소개

DOTS Physics와 소프트 부동소수점을 사용하는 Unity용 크로스 플랫폼 결정론적 물리 시뮬레이션

과학 및 공학

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

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:

  • Burst
  • Collections
  • Entities
  • Jobs

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:

  • All bodies must be created in the same order every time you create the simulation
  • Bodies must only be modified in a system that is updated in FixedStepSimulationSystemGroup
  • You must not use the result of floating point operations as input for the physics engine
  • Be careful when using hashmaps / hashsets, because iterating over them may be non-deterministic (it depends on the implementation).
  • Check how to use soft floats here.
  • Make sure that your code is also deterministic.

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.

관련 프로젝트 살펴보기

불러오는 중…