mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 14:59:47 +02:00
bug fix: bad logic in capsule-vs-capsule
This commit is contained in:
parent
7c8f5e2c12
commit
c5a5f8c5d4
1 changed files with 2 additions and 2 deletions
|
@ -364,12 +364,12 @@ bool capsuleCapsule(const CapsuleShape* capsuleA, const CapsuleShape* capsuleB,
|
|||
|
||||
// clamp the distances to the ends of the capsule line segments
|
||||
float absDistanceA = fabs(distanceA);
|
||||
if (absDistanceA > capsuleA->getHalfHeight() + capsuleA->getRadius()) {
|
||||
if (absDistanceA > capsuleA->getHalfHeight()) {
|
||||
float signA = distanceA < 0.0f ? -1.0f : 1.0f;
|
||||
distanceA = signA * capsuleA->getHalfHeight();
|
||||
}
|
||||
float absDistanceB = fabs(distanceB);
|
||||
if (absDistanceB > capsuleB->getHalfHeight() + capsuleB->getRadius()) {
|
||||
if (absDistanceB > capsuleB->getHalfHeight()) {
|
||||
float signB = distanceB < 0.0f ? -1.0f : 1.0f;
|
||||
distanceB = signB * capsuleB->getHalfHeight();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue