I'm currently evaluating Bullet for a 2D project, and I'm having a bit of trouble getting my rigid bodies to stick to two dimensions.
All rigid bodies in the world are using btCompoundShape objects with multiple btConvexHullShapes. Each convex hull shape is a 2D mesh extruded from -5 to 5 on the z-axis. In order to constrain the x and y rotation axes and the z-axis movement, I've tried the following:
- Setting the inertia along the x and y axes to 0, as suggested in the manual for character animation.
- Using a hinge constraint.
- Using a Generic6DOF constraint as described here.
Is there a fool-proof method for clamping Bullet to two dimensions?
Thanks!
NB. I've looked closely at Box2D as well, but Bullet has support for raycasting and kinematic bodies that are proving very useful. As I'm not an experienced physics programmer I don't know which needs more work, adding those features to Box2D or constraining Bullet to 2D.