Local scaling on Convex Hull is broken

pico
Posts: 229
Joined: Sun Sep 30, 2007 7:58 am

Local scaling on Convex Hull is broken

Post by pico »

Hi Erwin,

i found a serious problem (v2.70):

1. Make a uniform convex hull, apply local scaling
2. Make a box, the scale of one axis must be <= size of a convex hull axis
3. Simulation won't recognize collision early enough and system explodes

I modified BasicDemo.cpp to show the problem.

When removing the local scaling and applying the scale instead to the vertices the simulation works as intended.
Use the #define USE_LOCAL_SCALE to toggle the behaviors (line 141).

regards
You do not have the required permissions to view the files attached to this post.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Local scaling on Convex Hull is broken

Post by Erwin Coumans »

The local aabb needs to be recalculated, after a call to setLocalScaling.

It has been fixed in the subversion repository. If you can't wait for the fix, one workaround is to call the 'setLocalScaling' before adding the vertices. Or just call 'recalcLocalAabb' on the btConvexHullShape, after setLocalScaling.

Thanks for the report and reproduction case!
Erwin