Loading repository data…
Loading repository data…
snowkit / repository
A separation axis theorem collision library for Haxe.
A Separating Axis Theorem collision library for haxe
A simple collision example
var circle = new Circle( 300, 200, 50 );
var box = Polygon.rectangle( 0, 0, 50, 150 );
box.rotation = 45;
var collideInfo = Collision.shapeWithShape( circle, box );
if(collideInfo != null) {
//use collideInfo.separationX
// collideInfo.separationY
// collideInfo.normalAxisX
// collideInfo.normalAxisY
// collideInfo.overlap
}
https://snowkit.github.io/differ/
1.4.0 (Latest release, haxelib)
1.3.0
The goal of this release is as follows :
All of this was achieved, with the following changes.
VectorVector in the API
ShapeDrawer: drawLine,drawPointCollision.pointInPolyRay infinite mode instead of boolean
Rays test in usage0clone(), copy_from(other), reset()Vector classinto argument for all internal and external calls
Results<T> results cache helperResults<T>testCircleVsPolygon
rayVsRay with a negative overlapCommon util class, it's internal to SAT2D and simplified nowdrawVector in ShapeDrawer, wasn't used (use drawLine if needed)1.2.0
The biggest change for sure, renamed hxcollision to differ
Now that the library is getting more use its better to have a consistent name
and to have a more explicit path. Think of "differ" as a diff tool for shapes/rays,
it tells you how shapes differ (i.e the separation).
Collision.test to Collision.shapeWithShapeCollision.testShapes to Collision.shapeWithShapesCollision.rayShape to Collision.rayWithShapeCollision.rayShapes to Collision.rayWithShapesCollision.rayRay to Collision.rayWithRayCollision.rayRays to Collision.rayWithRaysCollision.rayRays to Collision.rayWithRaysdata.CollisionData to data.ShapeCollisiondata.RayCollisionData to data.RayCollisiondata.RayIntersectionData to data.RayIntersectionOpenFLDrawer, will replace with gist or test later1.1.0
Vector2D to Vector and cleaned up code to ONLY what is needed. This class is meant to be as small and easy to integrate as possible.BaseShape to Shape, continued refactoringCollision.testShapes to Collision.testCollision.testShapeList to Collision.testShapesCollision.rayCollision to Collision.rayseparation/unitVector behaviour (signs bugs)Polygon/Polygon collisions not returning best vectorsbeginFill using OpenFLDrawercollisionData in CheckCircles, shape2 wasn't assigned.separation/unitVector is now bound to shape1 as it should bedrawVector in OpenFLDrawer showing vector directiondrawShape in ShapeDrawer, will cast proper types and call appropriate drawing functions.1.0.4
Polygon.normalPolygon to Polygon.createtestShapeList for testing one shape with manyunitVector response (soon to be renamed also)BaseShape1.0.3
ShapeDrawer class, for drawing the shapes in a non specific way.1.0.2
1.0.1
Polygon.rectangle() to be non-centered1.0.0