I’m having a strange problem:
I have a Body that has an attached GeomSphere. Prior to executing the following code, it can collide with any object without issues. After executing the following, which is supposed to swap out the GeomSphere with one of a different size, it can only collide with other Bodies. It can’t, for example, collide with bodyless GeomBoxes.
I’ve verified that the collisions are detected when I loop over the contact object. The problem is that no matter what flags I set on contact, there is no visible effect on the spheres.
The sphere objects do start to rotate by some very tiny amount after the “collision,” though. Also, I’m using the current cvs version of odejava.
// Remove old geom objects
PlaceableGeom geo = (PlaceableGeom)this.sim_body.getGeom();
this.sim_body.removeGeom(geo);
space.remove(geo);
geo.delete();
geo=null;
// Add new geom objects
geo = new GeomSphere((float)(this.bounds.getWidth()
+ Marble.border_width
+ Marble.stroke_width)/2);
this.sim_body.addGeom(geo);
this.sim_geomIDs.add(geo.getNativeAddr());
space.addGeom(geo);