+ fixed issue related to temporary/root collision shape in btCollisionObject

+ normalize plane normal input for btStaticPlaneShape
+ fixed issue related to swapped collision detectors (SphereTriangleDetector in particular)
Thanks a lot to Andrey Tuganov for reporting the issue and his reproduction case ( http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=2143 )
This commit is contained in:
erwin.coumans
2008-07-11 05:39:31 +00:00
parent dcf9f8d857
commit 8f3e9603f3
23 changed files with 355 additions and 203 deletions

View File

@@ -117,6 +117,7 @@ void btConvexTriangleCallback::processTriangle(btVector3* triangle,int partId, i
btTriangleShape tm(triangle[0],triangle[1],triangle[2]);
tm.setMargin(m_collisionMarginTriangle);
btCollisionShape* tmpShape = ob->getCollisionShape();
ob->internalSetTemporaryCollisionShape( &tm );
btCollisionAlgorithm* colAlgo = ci.m_dispatcher1->findAlgorithm(m_convexBody,m_triBody,m_manifoldPtr);
@@ -129,7 +130,7 @@ 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( ob->getRootCollisionShape());
ob->internalSetTemporaryCollisionShape( tmpShape);
}