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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user