I got two movies showing my problem. The first is with cuboids, and they bounce as I would expect, you can watch them bounce in my project here: http://www.astrant.net/Bullet-Debug-Cuboids.mov
The second video shows my problem with spheres, they tend to really change direction when they bounce e.g. they come vertically down and after they bounce, they continue horizontally to the left or right, really unlike I expected.
http://www.astrant.net/Bullet-Debug-Spheres.mov
What you see is a sorta version of Pong, drawn with a Bullet Debugger (I wrote my own, really simple ES2 debug drawer). The top and bottom dots are the two paddles, I move the bottom one a bit in both videos. On the sides are 2 walls, static objects. I'm not sure if I got the paddles right, so perhaps the problem is with them?
The only change you see between the 2 videos are these lines of code:
Code: Select all
static const bool useSphereCollisionShapeForBouncers = true;
if(useSphereCollisionShapeForBouncers){
bouncerCollisionShape = new btSphereShape(1.f);
} else {
bouncerCollisionShape = new btBoxShape(btVector3(btScalar(.5),btScalar(.5),btScalar(.5)));
}
Thanks in Advance!