From 0fda843a7caaec9a0fac8052197b329c7d44136f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Tue, 5 Feb 2019 18:39:00 -0800 Subject: [PATCH] Cleanup. --- examples/common/bounds.cpp | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/examples/common/bounds.cpp b/examples/common/bounds.cpp index 6acbc1e8d..853a79e53 100644 --- a/examples/common/bounds.cpp +++ b/examples/common/bounds.cpp @@ -1429,37 +1429,13 @@ bool overlap(const Capsule& _capsuleA, const Capsule& _capsuleB) if (0.0f <= ta && 1.0f >= ta) { - Sphere sphereB; - sphereB.radius = _capsuleB.radius; - - if (0.0f >= tb) - { - sphereB.center = _capsuleB.pos; - } - else - { - sphereB.center = _capsuleB.end; - } - - return overlap(_capsuleA, sphereB); + return overlap(_capsuleA, Sphere{0.0f >= tb ? _capsuleB.pos : _capsuleB.end, _capsuleB.radius}); } if (0.0f <= tb && 1.0f >= tb) { - Sphere sphereA; - sphereA.radius = _capsuleA.radius; - - if (0.0f >= ta) - { - sphereA.center = _capsuleA.pos; - } - else - { - sphereA.center = _capsuleA.end; - } - - return overlap(_capsuleB, sphereA); + return overlap(_capsuleB, Sphere{0.0f >= ta ? _capsuleA.pos : _capsuleA.end, _capsuleA.radius}); } const Vec3 pa = 0.0f > ta ? _capsuleA.pos : _capsuleA.end;