Methods to compute more accurate inertia tensor for btCompoundShape and btConvexTriangleMeshShape.

Thanks to Ole K. for the fixes, see http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=2562
This commit is contained in:
erwin.coumans
2008-09-04 18:20:32 +00:00
parent 5d2720d267
commit 7380db7653
5 changed files with 268 additions and 1 deletions

View File

@@ -142,6 +142,14 @@ public:
return m_aabbTree;
}
///computes the exact moment of inertia and the transform from the coordinate system defined by the principal axes of the moment of inertia
///and the center of mass to the current coordinate system. "masses" points to an array of masses of the children. The resulting transform
///"principal" has to be applied inversely to all children transforms in order for the local coordinate system of the compound
///shape to be centered at the center of mass and to coincide with the principal axes. This also necessitates a correction of the world transform
///of the collision object by the principal transform.
void calculatePrincipalAxisTransform(btScalar* masses, btTransform& principal, btVector3& inertia) const;
private:
btScalar m_collisionMargin;
protected: