I got it working when the prim is axis aligned, but rotating it breaks it.
I rotated both positions by llGetRot, and it almost works, except when it's rotated 90 degrees about the z-axis, the output is flipped, i.e. collisions in 2D cartesian quadrant one come out -,+ instead of +,+.
So I'd like to make the coodinates output completely independant of rotation. They would be the cartesian location on the face where the collision happened, no matter what.
Here's the code in collision_start:
CODE
rotation rot=llGetRot();
vector hitpos=(llDetectedPos(0)*rot)-(llGetPos()*rot);