76 btScalar denom = 1.0f - dirA_dot_dirB * dirA_dot_dirB;
78 if ( denom == 0.0f ) {
81 tA = ( dirA_dot_trans - dirB_dot_trans * dirA_dot_dirB ) / denom;
84 else if ( tA > hlenA )
88 tB = tA * dirA_dot_dirB - dirB_dot_trans;
92 tA = tB * dirA_dot_dirB + dirA_dot_trans;
96 else if ( tA > hlenA )
98 }
else if ( tB > hlenB ) {
100 tA = tB * dirA_dot_dirB + dirA_dot_trans;
104 else if ( tA > hlenA )
113 ptsVector = translation - offsetA + offsetB;
137 btVector3 translation = translationB - translationA;
147 directionA, capsuleLengthA, directionB, capsuleLengthB );
149 btScalar distance = ptsVector.
length() - capsuleRadiusA - capsuleRadiusB;
151 if ( distance > distanceThreshold )
165 pointOnB = transformB.
getOrigin()+offsetB + normalOnB * capsuleRadiusB;
201 #ifdef USE_SEPDISTANCE_UTIL2
202 m_sepDistance((static_cast<
btConvexShape*>(body0->getCollisionShape()))->getAngularMotionDisc(),
203 (static_cast<
btConvexShape*>(body1->getCollisionShape()))->getAngularMotionDisc()),
261 btVector3 endPtOrg = pointInWorld + normalOnBInWorld*orgDepth;
263 newDepth = (endPt - pointInWorld).
dot(normalOnBInWorld);
264 startPt = endPt+normalOnBInWorld*newDepth;
267 endPt = pointInWorld + normalOnBInWorld*orgDepth;
269 newDepth = (endPt - startPt).
dot(normalOnBInWorld);
274 #ifdef DEBUG_CONTACTS
278 #endif //DEBUG_CONTACTS
312 #ifndef BT_DISABLE_CAPSULE_CAPSULE_COLLIDER
334 #endif //BT_DISABLE_CAPSULE_CAPSULE_COLLIDER
339 #ifdef USE_SEPDISTANCE_UTIL2
342 m_sepDistance.updateSeparatingDistance(body0->getWorldTransform(),body1->getWorldTransform());
358 #ifdef USE_SEPDISTANCE_UTIL2
363 #endif //USE_SEPDISTANCE_UTIL2
384 #ifdef USE_SEPDISTANCE_UTIL2
396 #endif //USE_SEPDISTANCE_UTIL2
404 virtual void setShapeIdentifiersA(
int partId0,
int index0){}
405 virtual void setShapeIdentifiersB(
int partId1,
int index1){}
422 :m_originalResult(result),
423 m_marginOnA(marginOnA),
424 m_marginOnB(marginOnB),
429 virtual void setShapeIdentifiersA(
int partId0,
int index0){}
430 virtual void setShapeIdentifiersB(
int partId1,
int index1){}
433 m_reportedDistance = depthOrg;
434 m_reportedNormalOnWorld = normalOnBInWorld;
436 btVector3 adjustedPointB = pointInWorldOrg - normalOnBInWorld*m_marginOnB;
437 m_reportedDistance = depthOrg+(m_marginOnA+m_marginOnB);
438 if (m_reportedDistance<0.f)
440 m_foundResult =
true;
442 m_originalResult->addContactPoint(normalOnBInWorld,adjustedPointB,m_reportedDistance);
454 btWithoutMarginResult withoutMargin(resultOut, min0Margin,min1Margin);
468 bool foundSepAxis =
true;
476 sepNormalWorldSpace,*resultOut);
491 sepNormalWorldSpace = withoutMargin.m_reportedNormalOnWorld;
493 minDist = withoutMargin.m_reportedDistance;
498 foundSepAxis = withoutMargin.m_foundResult && minDist<0;
538 bool foundSepAxis =
false;
546 sepNormalWorldSpace,*resultOut);
573 body0Wrap->
getWorldTransform(), vertices, minDist-threshold, maxDist, *resultOut);
610 bool perturbeA =
true;
615 if (radiusA < radiusB)
624 if ( perturbeAngle > angleLimit )
625 perturbeAngle = angleLimit;
649 #ifdef DEBUG_CONTACTS
651 #endif //DEBUG_CONTACTS
656 #ifdef DEBUG_CONTACTS
670 #ifdef USE_SEPDISTANCE_UTIL2
673 m_sepDistance.initSeparatingDistance(gjkPairDetector.
getCachedSeparatingAxis(),sepDist,body0->getWorldTransform(),body1->getWorldTransform());
675 #endif //USE_SEPDISTANCE_UTIL2
704 if (squareMot0 < col0->getCcdSquareMotionThreshold() &&
706 return resultFraction;
742 if (resultFraction > result.m_fraction)
743 resultFraction = result.m_fraction;
775 if (resultFraction > result.m_fraction)
776 resultFraction = result.m_fraction;
781 return resultFraction;