/collision2d

A simple Go library for performing 2D collision detection based on sat-js

Primary LanguageGoMIT LicenseMIT

Collision2D

Build Status GoDoc Coverage Status Go Report Card

About

Collision2D is a simple Go library for performing collision detection (and projection-based collision response) of simple 2D shapes. It uses the Separating Axis Theorem. It was based on the JavaScript library SAT-js by jriecken.

It supports detecting collisions between:

  • Circles (using Voronoi Regions.)
  • Convex Polygons (and simple Axis-Aligned Boxes, which are of course, convex polygons.)

It also supports checking whether a point is inside a circle or polygon.

It's released under the MIT license.

To import in your Go project you can use:

`import "github.com/Tarliton/collision2d"`