mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 19:10:49 +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
|
// clamp the distances to the ends of the capsule line segments
|
||||||
float absDistanceA = fabs(distanceA);
|
float absDistanceA = fabs(distanceA);
|
||||||
if (absDistanceA > capsuleA->getHalfHeight() + capsuleA->getRadius()) {
|
if (absDistanceA > capsuleA->getHalfHeight()) {
|
||||||
float signA = distanceA < 0.0f ? -1.0f : 1.0f;
|
float signA = distanceA < 0.0f ? -1.0f : 1.0f;
|
||||||
distanceA = signA * capsuleA->getHalfHeight();
|
distanceA = signA * capsuleA->getHalfHeight();
|
||||||
}
|
}
|
||||||
float absDistanceB = fabs(distanceB);
|
float absDistanceB = fabs(distanceB);
|
||||||
if (absDistanceB > capsuleB->getHalfHeight() + capsuleB->getRadius()) {
|
if (absDistanceB > capsuleB->getHalfHeight()) {
|
||||||
float signB = distanceB < 0.0f ? -1.0f : 1.0f;
|
float signB = distanceB < 0.0f ? -1.0f : 1.0f;
|
||||||
distanceB = signB * capsuleB->getHalfHeight();
|
distanceB = signB * capsuleB->getHalfHeight();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue