Skip to content

starikcetin/UnityNativeCollision

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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.

Features:
  • Generation of native half-edge mesh from Unity Meshes.
  • Fast convex polyhedron face/edge boolean collision detection.
  • Polyhedron intersection manifold generation (via Sutherland-Hodgman clipping)
  • Burst compiled jobs for single and batch collision operations.
  • Experimental bounding volume hierarchy.
  • NativeBuffer collection able to run off stackalloc.

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

Performance:

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.

Acknowledgments:

This work is in part derived from BounceLite by Irlan Robson (zLib License): https://github.com/irlanrobson/bounce_lite

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

About

SAT Collision in C# for Unity3D Burst Compiler

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%