Skip to content

A port of differ (open source SAT collision implementation) to C#

Notifications You must be signed in to change notification settings

mini-glitch/differ-monogame

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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
}

About

A port of differ (open source SAT collision implementation) to C#

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%