+ provide access to 'root' collision shape, in case the original collision shape is temporarily replaced by a child collision shape.

+ added MultiMaterialDemo showing how to use the new btTriangleIndexVertexMaterialArray.
Thanks to Alex Silverman for this contribution!
This commit is contained in:
erwin.coumans
2008-07-10 22:19:30 +00:00
parent b66e5350d0
commit 1c0fa00bc7
16 changed files with 900 additions and 22 deletions

View File

@@ -116,14 +116,9 @@ void btConvexTriangleCallback::processTriangle(btVector3* triangle,int partId, i
{
btTriangleShape tm(triangle[0],triangle[1],triangle[2]);
tm.setMargin(m_collisionMarginTriangle);
btCollisionShape* tmpShape = ob->getCollisionShape();
//copy over user pointers to temporary shape
tm.setUserPointer(tmpShape->getUserPointer());
ob->setCollisionShape( &tm );
ob->internalSetTemporaryCollisionShape( &tm );
btCollisionAlgorithm* colAlgo = ci.m_dispatcher1->findAlgorithm(m_convexBody,m_triBody,m_manifoldPtr);
///this should use the btDispatcher, so the actual registered algorithm is used
// btConvexConvexAlgorithm cvxcvxalgo(m_manifoldPtr,ci,m_convexBody,m_triBody);
@@ -134,11 +129,9 @@ void btConvexTriangleCallback::processTriangle(btVector3* triangle,int partId, i
colAlgo->processCollision(m_convexBody,m_triBody,*m_dispatchInfoPtr,m_resultOut);
colAlgo->~btCollisionAlgorithm();
ci.m_dispatcher1->freeCollisionAlgorithm(colAlgo);
ob->setCollisionShape( tmpShape );
ob->setCollisionShape( ob->getRootCollisionShape());
}
}