underscorediscovery/hxcollision — pull request #3 by Dvergar (2014-04-12 15:55:07+00:00)
Title: unitVector / separation fixed !?

Your sample was showing the unitVector pointing
to the collided shape with Circles collisions and
at the opposite with other types of collisions.

Polygon to Circle wouldn't return a correct
UnitVector (sample again).

By moving the distance piece of code from
checkPolygons to checkCircleVsPolygon
it ended up working.

There's only one unitVector while several
shapes are colliding and since there's no notion
of order it's a bit confusing to use.

I created two methods in CollisionData.hx
getUnitVectorOf & getSeparationOf so that one can
get a unit/separation vector for a specific
shape.

There were some weird behaviors with separation
in Circle to Circle collisions.

I updated the sample so that it shows vector
directions as well. I also displayed the
separation vector.

I think i remember you were using it for luxe,
so i might be misunderstanding its use or you're
using an updated version of it. In any case it
works for me now so i thought i would at least
let you review it.