From 8a062453ef5c2e52dffb5420e773a6548dc0c0bf Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Sat, 23 Jun 2018 13:08:10 -1000 Subject: [PATCH] Fix CAABox::pointInside --- include/zeus/CAABox.hpp | 5 +++-- include/zeus/CVector3d.hpp | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/include/zeus/CAABox.hpp b/include/zeus/CAABox.hpp index 8f48d28..79c083d 100644 --- a/include/zeus/CAABox.hpp +++ b/include/zeus/CAABox.hpp @@ -259,8 +259,9 @@ public: inline bool pointInside(const CVector3f& other) const { - return (min.x <= other.x && other.x <= max.z && min.y <= other.y && other.y <= max.z && min.z <= other.z && - other.z <= max.z); + return (min.x <= other.x && other.x <= max.x && + min.y <= other.y && other.y <= max.y && + min.z <= other.z && other.z <= max.z); } inline CVector3f closestPointAlongVector(const CVector3f& other) const diff --git a/include/zeus/CVector3d.hpp b/include/zeus/CVector3d.hpp index af6986b..5f0b8d6 100644 --- a/include/zeus/CVector3d.hpp +++ b/include/zeus/CVector3d.hpp @@ -106,7 +106,9 @@ public: double magnitude() const { return sqrt(magSquared()); } inline CVector3d cross(const CVector3d& rhs) const { - return {y * rhs.z - z * rhs.y, z * rhs.x - x * rhs.z, x * rhs.y - y * rhs.x}; + return {y * rhs.z - z * rhs.y, + z * rhs.x - x * rhs.z, + x * rhs.y - y * rhs.x}; } double dot(const CVector3d& rhs) const