Robust and simple implementation of the Expanding Polytope Algorithm (EPA).
The demo is written in C#, with OpenTK as only dependency.
The implementation itself is contained in UEPA.cs with ~400 lines of code. The algorithm detects whether two convex objects are separated or colliding and returns the points of closest distance and deepest penetration, respectively.
The expanding polytope algorithm is used also for the separating case - simplifying the algorithm for collision detection for the general case.
The demo should be able to run cross-platform utilizing OpenGL.
- Install the .NET 9.0 SDK
- git clone https://github.com/notgiven688/unified_epa.git
- cd unified_epa && dotnet run -c Release