Boxes going through walls

Hello! Now, this is not exactly a problem, since I found some good solutions, but the interesting bit is why these solutions were necessary. Basically, I have a small demo where it is possible to pick objects up and throw them, giving them a linear velocity in the cam.getDirection() (like the hello physics demo). It all works fine when throwing around in a room I made, for cylinders, capsules, etc. except for boxes! They simply fly out the roof when thrown. Now, I believe I nailed this down to having more triangles in the roof (not just a long diagonal), as well as increasing the accuracy of the physics.

However, it is weird that I have to do this, since cylinders and virtually all other shapes have worked perfectly. Maybe there could be some sort of quick-fix for this? This is not exactly a problem thread, more like “this could be fixed a little better”-thread, since the increase in accuracy is kind of pointless for all other aspects of the game (except for this damned book wanting to have wings… :slight_smile: )

a wild guess would be the box having less vertices / polys to calculate collision against?

of course your roof might be the problem as well :stuck_out_tongue:

its just how bullet is, weird shaped collision meshes just work better.

in another thread i saw someone’s solution was to make his cube shaped objects actually be a cube with a sphere on each corner of the cube to make the monstrosity cube.

also i take it youve used

setCcdMotionThreshold(.001f);
setCcdSweptSphereRadius(radiusOfYourObject);

ccd (continious something detection) is useful for small objects to help prevent this issue.