Hello,
As i described in the topic below, i want to test collision of two geoms with odejava.
http://www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=physics;action=display;num=1114546020
When i looked for the problem in Odejava sources, i found the following lines in the methods written in odejava.cpp:
// This callback collects all contacts data (dContactGeom) to buffers which
// can be later accessed on the Java side.
// Used with spaceCollide
static void nearCallback (void *data, dGeomID o1, dGeomID o2) {
// This function is called by ODE if two Geoms are near each other.
// Geoms o1 and o2 are near each other, if they actually collide then
// generate contact information (dContact structure) and add them
// to contact jointgroup.
dBodyID b1 = dGeomGetBody(o1);
dBodyID b2 = dGeomGetBody(o2);
// ignore if both o1 and o2 are plain Geoms (not bodies)
if (!b1 && !b2) return;
.....
// This callback collects all contacts data (dContactGeom) to buffers which
// can be later accessed on the Java side.
// Used with spaceCollide2
static void nearCallback2 (void *data, dGeomID o1, dGeomID o2) {
// This function is called by ODE if two Geoms are near each other.
// Geoms o1 and o2 are near each other, if they actually collide then
// generate contact information (dContact structure) and add them
// to contact jointgroup.
if (dGeomIsSpace (o1) || dGeomIsSpace (o2)) {
// colliding a space with something
dSpaceCollide2 (o1,o2,data,&nearCallback);
// collide all geoms internal to the space(s)
if (dGeomIsSpace (o1)) dSpaceCollide ((dSpaceID) o1,data,&nearCallback);
if (dGeomIsSpace (o2)) dSpaceCollide ((dSpaceID) o2,data,&nearCallback);
} else {
dBodyID b1 = dGeomGetBody(o1);
dBodyID b2 = dGeomGetBody(o2);
// ignore if both o1 and o2 are plain Geoms (not bodies)
if (!b1 && !b2) return;
.....
It seems that collision of two geoms are ignored in the implementation.
Here is the related “collision” section from ode user guide:
http://www.ode.org/ode-latest-userguide.html#sec_10_2_0
So, it seems that the current behavior is not compatible with what ODE says. I think this is done to improve performance in odejava. So, what are your thoughts? Should we compliant to ode or select performance option? Are there anybody using geom-geom collision?
Thanks for the opinions.