From 21c1ed29409e58c2d66f344da7ed8188db0c6150 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 12 Oct 2019 02:22:10 -0400 Subject: [PATCH] CBallCamera: Use bool instead of float for holding boolean value Using a float is very suspect and also more expensive in terms of code-gen to access and modify the variable. --- Runtime/Camera/CBallCamera.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Runtime/Camera/CBallCamera.cpp b/Runtime/Camera/CBallCamera.cpp index fd1e6437a..cc1b428c5 100644 --- a/Runtime/Camera/CBallCamera.cpp +++ b/Runtime/Camera/CBallCamera.cpp @@ -1750,7 +1750,8 @@ bool CBallCamera::DetectCollision(const zeus::CVector3f& from, const zeus::CVect zeus::CVector3f delta = to - from; float deltaMag = delta.magnitude(); zeus::CVector3f deltaNorm = delta * (1.f / deltaMag); - float clear = true; + bool clear = true; + if (deltaMag > 0.000001f) { float margin = 2.f * radius; zeus::CAABox aabb;