A warning!

Sunken
Posts: 9
Joined: Thu Oct 28, 2010 1:40 pm

A warning!

Post by Sunken »

I just spent a whole afternoon trying to figure out why my contactTest calls didn't work, or rather worked only sometimes, sometimes just ignoring overlaps - making my randomly instantiated scene explode immediately.
I tried calling all sorts of update functions ahead of the contactTest call, I tried removing the objects and reinserting them one at a time, I tried running an extra simulation step before the test - nothing helped.

Now I found the reason: I had initialized the orientation matrix column-major instead of row-major.

I would never have noticed, since Bullet fixes the matrix as soon as you simulate a step and gives no warning that I am aware of. The only reason I figured it out was that I was using the Glut demo framework for visualization, and I tried halting the simulation before the first step to inspect the state - and the bodies were all skewed out of shape!

Moral: watch your inputs.