Skip to content

Latest commit

 

History

History
29 lines (19 loc) · 852 Bytes

README.md

File metadata and controls

29 lines (19 loc) · 852 Bytes

What is differ-cs?

A port of the original differ for Haxe (https://github.com/underscorediscovery/differ). The port is (where possible) a one-to-one mapping, with a few changes to the API (no more out parameters). This is a Separating Axis Theorom collision library for C# games, intended for use in MonoGame.


Details

  • Supports polygons, circles, and rays currently
  • 2D only
  • COLLISION ONLY. No physics
  • Project is a .net core library

Quick look

A simple collision example

var circle = new Circle( 300, 200, 50 );
var box = Polygon.Rectangle( 0, 0, 50, 150 );

box.Rotation = 45;

if (circle.CollidesWith(box, out var collideInfo)) 
{
    // collideInfo.Separation
    // collideInfo.Normal
    // collideInfo.Overlap
}