[odejava] Multiple geoms in a body

Wow, I’m really on a roll :slight_smile: I’ve been trying to use multiple geoms in a body to simulate the elipsoid shape (ish) that I wanted. However, it wasn’t working at all, no physics at all. I found that at least one of the geoms had to be a (0,0,0) within its GeomTransform for anything to actually happen. So, I’ve ended up sticking a :

geom = new GeomSphere(0);

in every body I create that doesn’t have its own zeroed geometry and this fixes the problem.

Kev

I had the same problem, ultimately resolving it by playing with the statement execution order. This works for me:

GeomBox gb = new GeomBox(1.0f, 1.0f, 1.25fORIGIN.z);
gb.setPosition(new Vector3f(0.0f, 0.0f, -0.375f
ORIGIN.z));

GeomTransform gt = new GeomTransform();
gt.setEncapsulatedGeom(gb);

body = new Body(“camera”, world, gt);

I too have found that the order of statements is important in many cases (an ODE limitation).

Will.