]> git.localhorst.tv Git - blank.git/blobdiff - src/model/bounds.hpp
renamed Shape -> CollisionBounds
[blank.git] / src / model / bounds.hpp
diff --git a/src/model/bounds.hpp b/src/model/bounds.hpp
new file mode 100644 (file)
index 0000000..05f8df1
--- /dev/null
@@ -0,0 +1,56 @@
+#ifndef BLANK_MODEL_BOUNDS_HPP_
+#define BLANK_MODEL_BOUNDS_HPP_
+
+#include "CollisionBounds.hpp"
+#include "geometry.hpp"
+
+#include <vector>
+#include <glm/glm.hpp>
+
+
+namespace blank {
+
+class NullBounds
+: public CollisionBounds {
+
+public:
+       NullBounds();
+
+       bool Intersects(const Ray &, const glm::mat4 &, float &, glm::vec3 &) const noexcept override;
+       bool Intersects(const glm::mat4 &, const AABB &, const glm::mat4 &, float &, glm::vec3 &) const noexcept override;
+
+};
+
+
+class CuboidBounds
+: public CollisionBounds {
+
+public:
+       CuboidBounds(const AABB &bounds);
+
+       bool Intersects(const Ray &, const glm::mat4 &, float &, glm::vec3 &) const noexcept override;
+       bool Intersects(const glm::mat4 &, const AABB &, const glm::mat4 &, float &, glm::vec3 &) const noexcept override;
+
+private:
+       AABB bb;
+
+};
+
+
+class StairBounds
+: public CollisionBounds {
+
+public:
+       StairBounds(const AABB &bounds, const glm::vec2 &clip);
+
+       bool Intersects(const Ray &, const glm::mat4 &, float &, glm::vec3 &) const noexcept override;
+       bool Intersects(const glm::mat4 &, const AABB &, const glm::mat4 &, float &, glm::vec3 &) const noexcept override;
+
+private:
+       AABB top, bot;
+
+};
+
+}
+
+#endif