Home

Awesome

UnityNativeCollision

This project is an experimental C# implementation of polyhedron SAT collision and intersection for the Unity game engine. It's specifically designed to be compatible with Unity's Burst Compiler for performance.

Acknowledgments:

The math is ported to C# from the C++ BounceLite project by Irlan Robson (zLib License) and adapted for Unity's new Math library and Burst Compiler requirments: https://github.com/irlanrobson/bounce_lite

The SAT implementation is originally based on the 2013 GDC presentation by Dirk Gregorius and his forum posts about Valve's Rubikon physics engine:

Features:
<img src="https://i.imgur.com/2r6IAtB.gif" target="_blank" />

Note: Project was created with Unity 2019.2, older versions may not work.

Performance:
<img src="https://i.imgur.com/mfPtfYv.jpg" target="_blank" />
Contact Visualization:

View a fast version of the contact for physics calcluations. This mode a processes a minimal set of geometry, just enough to move colliding objects apart. Versus the full intersection mode, which needs to clip every face for visual/mesh creation purposes.

<img src="https://i.imgur.com/gj2kGu0.gif" target="_blank" />