small improvement in btConvexPlaneCollisionAlgorithm

This commit is contained in:
ejcoumans
2007-12-11 23:35:37 +00:00
parent a7e04dbdc2
commit 4c69ee93e2

View File

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