When I refer to the axis from the Sat test, i mean the line marked in red. Which when a collision has occured, is the axis of minimum penetration of the objects. My sat test is defined to return a bool, and takes a reference as a parameter to a contactNormal which is set if a collision occurs.
bool Sat( object o1, object o2, Vector2& ContactNormal ){ if( collision ) { // figure out which way axis is to point, ie // ContactNormal = axis; // or // ContactNormal = -axis; return 1; } else return 0;}
Now that line marked in red can point in 2 directions, when that line is set to the correct direction, i refer to that as the contact normal, which is the arrow marked in red.
Quote:
But why should we go further? You posted a figure with two possible normals: have you at least tested my algorithm with an arbitrary choice of contact normal between the two possibilities? Start there first.
I dont know what you mean. There is only one normal in those diagrams, marked by the red arrow. That is, to point towards A by convention, as in the diagram.
My problem at the moment is figuring out which way the axis should point when set for the contact normal. I've defined the fact that it needs to point towards A by convention, but I need a way to calculate this, as that red line ( which I refer to as the axis of collision ) when passed as the contact normal, could be -axis or +axis, shown above in the source code.
Doesnt this need to be calculated before moving onto the closing velocity test which I believe you're refering to in the following reply
Quote:have you at least tested my algorithm with an arbitrary choice of contact normal between the two possibilities? Start there first
What Im trying to say is that before I use the closing velocty test, provided there is a collision, I first need to get the contact normal for that collision, pointing towards A.
All I have at the moment is the axis, ( shown by the red line ). I need to now get a contact normal from that, which always points towards A.
That is, I need to figure out should the Contact Normal be
ContactNormal = axis;
or
ContactNormal = -axis;