btCompoundShape, sphere shape scaling.

Alundra
Posts: 14
Joined: Sat Aug 13, 2011 3:25 pm

btCompoundShape, sphere shape scaling.

Post by Alundra »

Hi,
Using a btCompoundShape to set a list of collision shape, btSphereShape is scaled when
SetLocalScaling is used or it need to use a btMultiSphereShape with just 1 sphere ?

Thanks to answer
Flix
Posts: 456
Joined: Tue Dec 25, 2007 1:06 pm

Re: btCompoundShape, sphere shape scaling.

Post by Flix »

I may be wrong, but I usually avoid using btCompoundShape::setLocalScaling(...).
btSphereShape::setLocalScaling(...) should work if you use the same value for each component (uniform scaling).
btMultiSphereShape with just 1 sphere is the only way to create non-uniformly scaled sphere shapes.

Hope it helps.

P.S. Please note that setLocalScaling affects all the bodies that share that collision shape.