yeah this is correct.
Its so that clever optimizations can be done:
It allows a geom that knows its own geometry can quickly rule out a collision with another geom, even if it only knows the other geoms AABB. So returning true only means the collision system will go onto the next round of collision testing (i.e. using the colliders).
So the AABBTest function is not the test to see whether two AABB intersect. It is a test a Geom can perform (so its geom specific) against an unkown other geom. It is not used very widley used, if at all at in ODE (it is ODE’s archetecture not mine).
The real AABB test for two AABB is in Space:-
public static void collideAABBs(Geom g1, Geom g2, Object data,
NearCallback callback) {
if (!((g1.gflags & GEOM_AABB_BAD) == 0))
throw new IllegalArgumentException(g1.getClass().getName());
if (!((g2.gflags & GEOM_AABB_BAD) == 0))
throw new IllegalArgumentException();
// no contacts if both geoms on the same body, and the body is not 0
if (g1.body == g2.body && g1.body != null)
return;
// test if the category and collide bitfields match
if ((((g1.category_bits & g2.collide_bits) !=0 || (g2.category_bits & g1.collide_bits) != 0)) == false) {
return;
}
// if the bounding boxes are disjoint then don't do anything
float[] bounds1 = g1.aabb;
float[] bounds2 = g2.aabb;
if (bounds1[0] > bounds2[1] || bounds1[1] < bounds2[0]
|| bounds1[2] > bounds2[3] || bounds1[3] < bounds2[2]
|| bounds1[4] > bounds2[5] || bounds1[5] < bounds2[4]) {
return;
}
// check if either object is able to prove that it doesn't intersect the
// AABB of the other
if (g1.AABBTest(g2, bounds2) == false)
return;
if (g2.AABBTest(g1, bounds1) == false)
return;
// the objects might actually intersect - call the space callback
// function
callback.call(data, g1, g2);
}