fix for static planeshape and spheres, need to use the getSupportingVertex with margin for proper contact point location.
This commit is contained in:
@@ -71,9 +71,9 @@ void btConvexPlaneCollisionAlgorithm::processCollision (btCollisionObject* body0
|
|||||||
btTransform convexInPlaneTrans;
|
btTransform convexInPlaneTrans;
|
||||||
convexInPlaneTrans= planeObj->getWorldTransform().inverse() * convexObj->getWorldTransform();
|
convexInPlaneTrans= planeObj->getWorldTransform().inverse() * convexObj->getWorldTransform();
|
||||||
|
|
||||||
btVector3 vtx = convexShape->localGetSupportingVertexWithoutMargin(planeInConvex.getBasis()*-planeNormal);
|
btVector3 vtx = convexShape->localGetSupportingVertex(planeInConvex.getBasis()*-planeNormal);
|
||||||
btVector3 vtxInPlane = convexInPlaneTrans(vtx);
|
btVector3 vtxInPlane = convexInPlaneTrans(vtx);
|
||||||
btScalar distance = (planeNormal.dot(vtxInPlane) - planeConstant) - convexShape->getMargin();
|
btScalar distance = (planeNormal.dot(vtxInPlane) - planeConstant);
|
||||||
|
|
||||||
btVector3 vtxInPlaneProjected = vtxInPlane - distance*planeNormal;
|
btVector3 vtxInPlaneProjected = vtxInPlane - distance*planeNormal;
|
||||||
btVector3 vtxInPlaneWorld = planeObj->getWorldTransform() * vtxInPlaneProjected;
|
btVector3 vtxInPlaneWorld = planeObj->getWorldTransform() * vtxInPlaneProjected;
|
||||||
|
|||||||
Reference in New Issue
Block a user