From 92733a3bb7c62f26bbcc0dfaf89be11636288b7f Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Sat, 6 Apr 2019 19:01:22 -1000 Subject: [PATCH] Fix some compilation warnings --- include/zeus/CAABox.hpp | 2 +- include/zeus/CQuaternion.hpp | 9 --------- src/CAABox.cpp | 2 +- src/CQuaternion.cpp | 9 +++++++++ 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/zeus/CAABox.hpp b/include/zeus/CAABox.hpp index bf71d11..c010f72 100644 --- a/include/zeus/CAABox.hpp +++ b/include/zeus/CAABox.hpp @@ -137,7 +137,7 @@ public: struct Tri { zeus::CPlane x0_plane; - zeus::CVector3f x10_[3]; + zeus::CVector3f x10_verts[3]; }; Tri getTri(EBoxFaceId face, int windOffset) const; diff --git a/include/zeus/CQuaternion.hpp b/include/zeus/CQuaternion.hpp index 24f78f1..5ab09de 100644 --- a/include/zeus/CQuaternion.hpp +++ b/include/zeus/CQuaternion.hpp @@ -17,15 +17,6 @@ namespace zeus { -static float normalize_angle(float angle) { - if (angle > M_PIF) - angle -= 2.f * M_PIF; - else if (angle < -M_PIF) - angle += 2.f * M_PIF; - - return angle; -} - class CNUQuaternion; /** Unit quaternion, used for all quaternion arithmetic */ diff --git a/src/CAABox.cpp b/src/CAABox.cpp index 2793222..dcdfbc6 100644 --- a/src/CAABox.cpp +++ b/src/CAABox.cpp @@ -156,7 +156,7 @@ CAABox::Tri CAABox::getTri(EBoxFaceId face, int windOffset) const { break; } return {zeus::CPlane(verts[windOffset % 2], verts[(windOffset + 1) % 2], verts[(windOffset + 2) % 2]), - verts[windOffset % 2], verts[(windOffset + 1) % 2], verts[(windOffset + 2) % 2]}; + {verts[windOffset % 2], verts[(windOffset + 1) % 2], verts[(windOffset + 2) % 2]}}; } } // namespace zeus diff --git a/src/CQuaternion.cpp b/src/CQuaternion.cpp index 323193f..91b6ecb 100644 --- a/src/CQuaternion.cpp +++ b/src/CQuaternion.cpp @@ -275,6 +275,15 @@ CRelAngle CQuaternion::angleFrom(const zeus::CQuaternion& other) { return std::acos(zeus::clamp(-1.f, dot(other), 1.f)); } +static float normalize_angle(float angle) { + if (angle > M_PIF) + angle -= 2.f * M_PIF; + else if (angle < -M_PIF) + angle += 2.f * M_PIF; + + return angle; +} + CQuaternion CQuaternion::lookAt(const CUnitVector3f& source, const CUnitVector3f& dest, const CRelAngle& maxAng) { CQuaternion q; zeus::CVector3f destNoZ = dest;