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

@@ -22,21 +22,15 @@ subject to the following restrictions:
#include "LinearMath/btAabbUtil2.h"
///The btMultiSphereShape represents the convex hull of a collection of spheres. You can create special capsules or other smooth volumes.
///It is possible to animate the spheres for deformation.
///It is possible to animate the spheres for deformation, but call 'recalcLocalAabb' after changing any sphere position/radius
class btMultiSphereShape : public btConvexInternalAabbCachingShape
{
btAlignedObjectArray<btVector3> m_localPositionArray;
btAlignedObjectArray<btScalar> m_radiArray;
btVector3 m_inertiaHalfExtents;
public:
btMultiSphereShape (const btVector3& inertiaHalfExtents,const btVector3* positions,const btScalar* radi,int numSpheres);
btMultiSphereShape (const btVector3* positions,const btScalar* radi,int numSpheres);
///CollisionShape Interface
virtual void calculateLocalInertia(btScalar mass,btVector3& inertia) const;