fix for static planeshape and spheres, need to use the getSupportingVertex with margin for proper contact point location.

This commit is contained in:
ejcoumans
2008-01-23 02:42:14 +00:00
parent f12f04fb97
commit 63dc666bf6

View File

@@ -71,9 +71,9 @@ void btConvexPlaneCollisionAlgorithm::processCollision (btCollisionObject* body0
btTransform convexInPlaneTrans;
convexInPlaneTrans= planeObj->getWorldTransform().inverse() * convexObj->getWorldTransform();
btVector3 vtx = convexShape->localGetSupportingVertexWithoutMargin(planeInConvex.getBasis()*-planeNormal);
btVector3 vtx = convexShape->localGetSupportingVertex(planeInConvex.getBasis()*-planeNormal);
btVector3 vtxInPlane = convexInPlaneTrans(vtx);
btScalar distance = (planeNormal.dot(vtxInPlane) - planeConstant) - convexShape->getMargin();
btScalar distance = (planeNormal.dot(vtxInPlane) - planeConstant);
btVector3 vtxInPlaneProjected = vtxInPlane - distance*planeNormal;
btVector3 vtxInPlaneWorld = planeObj->getWorldTransform() * vtxInPlaneProjected;