diff options
Diffstat (limited to 'src/Math/AABB.hpp')
| -rw-r--r-- | src/Math/AABB.hpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/Math/AABB.hpp b/src/Math/AABB.hpp index 53ce6d2..4ad5534 100644 --- a/src/Math/AABB.hpp +++ b/src/Math/AABB.hpp @@ -1,6 +1,7 @@ #pragma once #include <array> +#include <vector> #include "Vector.hpp" #include "../Common/Lambda.hpp" @@ -41,6 +42,13 @@ struct AABB { return intersects_on_x(other) && intersects_on_y(other) && intersects_on_z(other); } + Bool collides(std::vector<AABB> others) { + for (auto& other : others) { + if (collides(other)) return true; + } + return false; + } + std::array<Vector<3>, 8> corners() const { return {{ {min.x(), min.y(), min.z()}, @@ -68,7 +76,7 @@ struct AABB { }; } - AABB collision_response(Vector<3> v, AABB against) const; + Vec3 pushout(Vector<3> v, AABB against) const; Vector<3> min, max; }; |
