Objects colliding in empty space

console
Posts: 18
Joined: Thu Sep 04, 2008 10:25 am

Objects colliding in empty space

Post by console »

I'm using Bullet for physics and collision detection. For the most part it works, but I have one problem that I am unable to solve.

If I create a primitive object that has the same dimensions along all sides, the collision detection system works as expected. However, if I create a primitive object that has some faces that are longer than other faces, objects appear to collide away from each other, in empty space. This problem doesn't occur when using a collection of convex hulls.

I've checked and the margin for collision detection isn't causing the problem. Also, I have verified that the axes correspond between Bullet and my display (so that I'm displaying the simulation exactly as Bullet "sees" it).

Does anyone have any ideas as to what is going wrong?
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Objects colliding in empty space

Post by Erwin Coumans »

What kind of collision shapes are you creating?

The best way is to implement debug visualization, using a derived version of btIDebugDraw.

Alternatively, export the file to COLLADA, using a snapshot.
Hope this helps,
Erwin
console
Posts: 18
Joined: Thu Sep 04, 2008 10:25 am

Re: Objects colliding in empty space

Post by console »

Thanks for your advice. Using the debug visualisation, I realised that I was using the margins incorrectly. I've since rectified my code and everything works.

By the way, the shapes were cuboids, cones and cylinders.