X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fworld%2FAABB.cpp;h=92c8ba2014f017632c54e7c50074010f8f973a86;hb=03b142b877e19a2355e1a79e279e024922d44655;hp=edce97e313dfe3f832dab4204f6ca0d100dc7643;hpb=a8523bee4fc349a800f5f6d67b470c3a801beaa9;p=orbi.git diff --git a/src/world/AABB.cpp b/src/world/AABB.cpp index edce97e..92c8ba2 100644 --- a/src/world/AABB.cpp +++ b/src/world/AABB.cpp @@ -6,11 +6,16 @@ namespace orbi { -bool AABB::Intersects(const AABB &other, Collision &coll) const { +bool AABB::Intersects(const AABB &other) const { if (Bottom() < other.Top()) return false; if (other.Bottom() < Top()) return false; if (Right() < other.Left()) return false; if (other.Right() < Left()) return false; + return true; +} + +bool AABB::Intersects(const AABB &other, Collision &coll) const { + if (!Intersects(other)) return false; AABB diff; diff.lt = max(lt, other.lt);