Cube stacking as boxShape vs ConvexHull

codetiger
Posts: 19
Joined: Sat Aug 18, 2012 2:20 am
Location: Chennai, India

Cube stacking as boxShape vs ConvexHull

Post by codetiger »

We are working on a game that involves stacking of some objects. Not too many but atleast 10 to 15 levels. And the objects are built using ConvexHull Shape.

Actual Result:
The Objects jump in the beginning as if they where placed overlapping.

Note:
The same problem doesn't happen when we build the same size objects using BoxShape. It only happens in ConvexHull. Considering a Cube, does BoxShape differ from making convexhull? Should we add scale the object a little bit when we use convexhullshape?
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Cube stacking as boxShape vs ConvexHull

Post by Erwin Coumans »

A btConvexHullShape uses a default collision margin of 0.04 units.

It is best not to set this margin to zero, but shrink the graphics object instead.
Thanks,
Erwin