propagate resultOut->m_closestPointDistanceThreshold properly for convex-convex (capsule, sphere) and convex vs plane
This commit is contained in:
@@ -296,7 +296,7 @@ void btConvexConvexAlgorithm ::processCollision(const btCollisionObjectWrapper*
|
|||||||
btCapsuleShape* capsuleA = (btCapsuleShape*)min0;
|
btCapsuleShape* capsuleA = (btCapsuleShape*)min0;
|
||||||
btCapsuleShape* capsuleB = (btCapsuleShape*)min1;
|
btCapsuleShape* capsuleB = (btCapsuleShape*)min1;
|
||||||
|
|
||||||
btScalar threshold = m_manifoldPtr->getContactBreakingThreshold();
|
btScalar threshold = m_manifoldPtr->getContactBreakingThreshold()+ resultOut->m_closestPointDistanceThreshold;
|
||||||
|
|
||||||
btScalar dist = capsuleCapsuleDistance(normalOnB, pointOnBWorld, capsuleA->getHalfHeight(), capsuleA->getRadius(),
|
btScalar dist = capsuleCapsuleDistance(normalOnB, pointOnBWorld, capsuleA->getHalfHeight(), capsuleA->getRadius(),
|
||||||
capsuleB->getHalfHeight(), capsuleB->getRadius(), capsuleA->getUpAxis(), capsuleB->getUpAxis(),
|
capsuleB->getHalfHeight(), capsuleB->getRadius(), capsuleA->getUpAxis(), capsuleB->getUpAxis(),
|
||||||
@@ -318,7 +318,7 @@ void btConvexConvexAlgorithm ::processCollision(const btCollisionObjectWrapper*
|
|||||||
btCapsuleShape* capsuleA = (btCapsuleShape*)min0;
|
btCapsuleShape* capsuleA = (btCapsuleShape*)min0;
|
||||||
btSphereShape* capsuleB = (btSphereShape*)min1;
|
btSphereShape* capsuleB = (btSphereShape*)min1;
|
||||||
|
|
||||||
btScalar threshold = m_manifoldPtr->getContactBreakingThreshold();
|
btScalar threshold = m_manifoldPtr->getContactBreakingThreshold()+ resultOut->m_closestPointDistanceThreshold;
|
||||||
|
|
||||||
btScalar dist = capsuleCapsuleDistance(normalOnB, pointOnBWorld, capsuleA->getHalfHeight(), capsuleA->getRadius(),
|
btScalar dist = capsuleCapsuleDistance(normalOnB, pointOnBWorld, capsuleA->getHalfHeight(), capsuleA->getRadius(),
|
||||||
0., capsuleB->getRadius(), capsuleA->getUpAxis(), 1,
|
0., capsuleB->getRadius(), capsuleA->getUpAxis(), 1,
|
||||||
@@ -340,7 +340,7 @@ void btConvexConvexAlgorithm ::processCollision(const btCollisionObjectWrapper*
|
|||||||
btSphereShape* capsuleA = (btSphereShape*)min0;
|
btSphereShape* capsuleA = (btSphereShape*)min0;
|
||||||
btCapsuleShape* capsuleB = (btCapsuleShape*)min1;
|
btCapsuleShape* capsuleB = (btCapsuleShape*)min1;
|
||||||
|
|
||||||
btScalar threshold = m_manifoldPtr->getContactBreakingThreshold();
|
btScalar threshold = m_manifoldPtr->getContactBreakingThreshold()+ resultOut->m_closestPointDistanceThreshold;
|
||||||
|
|
||||||
btScalar dist = capsuleCapsuleDistance(normalOnB, pointOnBWorld, 0., capsuleA->getRadius(),
|
btScalar dist = capsuleCapsuleDistance(normalOnB, pointOnBWorld, 0., capsuleA->getRadius(),
|
||||||
capsuleB->getHalfHeight(), capsuleB->getRadius(), 1, capsuleB->getUpAxis(),
|
capsuleB->getHalfHeight(), capsuleB->getRadius(), 1, capsuleB->getUpAxis(),
|
||||||
@@ -480,7 +480,7 @@ void btConvexConvexAlgorithm ::processCollision(const btCollisionObjectWrapper*
|
|||||||
btPolyhedralConvexShape* polyhedronB = (btPolyhedralConvexShape*)min1;
|
btPolyhedralConvexShape* polyhedronB = (btPolyhedralConvexShape*)min1;
|
||||||
if (polyhedronA->getConvexPolyhedron() && polyhedronB->getConvexPolyhedron())
|
if (polyhedronA->getConvexPolyhedron() && polyhedronB->getConvexPolyhedron())
|
||||||
{
|
{
|
||||||
btScalar threshold = m_manifoldPtr->getContactBreakingThreshold();
|
btScalar threshold = m_manifoldPtr->getContactBreakingThreshold()+ resultOut->m_closestPointDistanceThreshold;
|
||||||
|
|
||||||
btScalar minDist = -1e30f;
|
btScalar minDist = -1e30f;
|
||||||
btVector3 sepNormalWorldSpace;
|
btVector3 sepNormalWorldSpace;
|
||||||
@@ -547,7 +547,7 @@ void btConvexConvexAlgorithm ::processCollision(const btCollisionObjectWrapper*
|
|||||||
|
|
||||||
//tri->initializePolyhedralFeatures();
|
//tri->initializePolyhedralFeatures();
|
||||||
|
|
||||||
btScalar threshold = m_manifoldPtr->getContactBreakingThreshold();
|
btScalar threshold = m_manifoldPtr->getContactBreakingThreshold()+ resultOut->m_closestPointDistanceThreshold;
|
||||||
|
|
||||||
btVector3 sepNormalWorldSpace;
|
btVector3 sepNormalWorldSpace;
|
||||||
btScalar minDist = -1e30f;
|
btScalar minDist = -1e30f;
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ void btConvexPlaneCollisionAlgorithm::processCollision(const btCollisionObjectWr
|
|||||||
btVector3 vtxInPlaneProjected = vtxInPlane - distance * planeNormal;
|
btVector3 vtxInPlaneProjected = vtxInPlane - distance * planeNormal;
|
||||||
btVector3 vtxInPlaneWorld = planeObjWrap->getWorldTransform() * vtxInPlaneProjected;
|
btVector3 vtxInPlaneWorld = planeObjWrap->getWorldTransform() * vtxInPlaneProjected;
|
||||||
|
|
||||||
hasCollision = distance < m_manifoldPtr->getContactBreakingThreshold();
|
hasCollision = distance < m_manifoldPtr->getContactBreakingThreshold()+ resultOut->m_closestPointDistanceThreshold;
|
||||||
resultOut->setPersistentManifold(m_manifoldPtr);
|
resultOut->setPersistentManifold(m_manifoldPtr);
|
||||||
if (hasCollision)
|
if (hasCollision)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user