Calculate multiple contact points (for convex-convex and convex-plane) when less then 3 points exist in the persistent manifold.

Uses the normal pertubation method, described by Gino van den Bergen:  http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=4&t=288&p=888#p888
Made btRigidBody::getInvInertiaDiagLocal const, thanks to abhikp (http://code.google.com/p/bullet/issues/detail?id=183 )
This commit is contained in:
erwin.coumans
2009-02-03 00:54:01 +00:00
parent bcbe730471
commit 0754876d77
7 changed files with 145 additions and 30 deletions

View File

@@ -52,6 +52,14 @@ btManifoldResult::btManifoldResult(btCollisionObject* body0,btCollisionObject* b
m_rootTransB = body1->getWorldTransform();
}
void btManifoldResult::addLocalContactPointInternal(const btVector3& normalOnBInWorld,const btVector3& localPointA,const btVector3& localPointB)
{
btVector3 worldPointA = m_rootTransA( localPointA );
btVector3 worldPointB = m_rootTransB( localPointB );
btScalar depth = (worldPointA - worldPointB).dot(normalOnBInWorld);
addContactPoint(normalOnBInWorld,worldPointB,depth);
}
void btManifoldResult::addContactPoint(const btVector3& normalOnBInWorld,const btVector3& pointInWorld,btScalar depth)
{