Remove first argument from btMultiSphereShape, calculate local inertia approximation from aabb.

If user wants more accurate inertia tensor for multi-sphere shape, use btCompoundShape instead 
(amd btCompoundShape::calculatePrincipalAxisTransform)

Thanks rcharlton for bringing this up.
Erwin
This commit is contained in:
erwin.coumans
2009-06-11 13:51:48 +00:00
parent 6c80353556
commit f552a1dbbf
4 changed files with 17 additions and 35 deletions

View File

@@ -181,12 +181,12 @@ plCollisionShapeHandle plNewBoxShape(plReal x, plReal y, plReal z)
plCollisionShapeHandle plNewCapsuleShape(plReal radius, plReal height)
{
//capsule is convex hull of 2 spheres, so use btMultiSphereShape
btVector3 inertiaHalfExtents(radius,height,radius);
const int numSpheres = 2;
btVector3 positions[numSpheres] = {btVector3(0,height,0),btVector3(0,-height,0)};
btScalar radi[numSpheres] = {radius,radius};
void* mem = btAlignedAlloc(sizeof(btMultiSphereShape),16);
return (plCollisionShapeHandle) new (mem)btMultiSphereShape(inertiaHalfExtents,positions,radi,numSpheres);
return (plCollisionShapeHandle) new (mem)btMultiSphereShape(positions,radi,numSpheres);
}
plCollisionShapeHandle plNewConeShape(plReal radius, plReal height)
{