Jun 10, 2009 at 11:54 PM
Edited Jun 10, 2009 at 11:55 PM
I've been looking into the "bug" (A feature actually) with the contact normals and everything is setup the correct way engine wise.
The engine arranges the geometries in the order in which they are created. It needs some way of determine what geometry to check first (in a consistent way) and in this case, the Id of the geometry is used. The geometry created first gets Id 0, the next
is 1, and so on.
The geometry with the lowest Id always gets ordered as GeometryA in the Arbiter, this makes sure that the collision response is consistent.
So basically the engine asks the question: In what direction do I need to apply impulse in order to separate geometry A from geometry B.
Whenever you switch the geometries around in your sample, that question is still being answered correctly by the engine and the proper result comes out of it.
It does not care what geometry is on top. - All in all it does not care about orientation of the geometries.
Now, I've been thinking about this and I've not been able to come up with a decent fix. It would not be any good if I introduced any kind of orientation-awareness into the engine. If you have any ideas, let me know.
I still think that the solution that checks the orientation is the one to use. (simply: if (geom1.Position.Y > geom2.Position.Y) ) is better than relying on the contact normals.