]> git.localhorst.tv Git - blank.git/blobdiff - src/model/shapes.hpp
some code reorganization
[blank.git] / src / model / shapes.hpp
diff --git a/src/model/shapes.hpp b/src/model/shapes.hpp
new file mode 100644 (file)
index 0000000..b5e965a
--- /dev/null
@@ -0,0 +1,53 @@
+#ifndef BLANK_MODEL_SHAPES_HPP_
+#define BLANK_MODEL_SHAPES_HPP_
+
+#include "geometry.hpp"
+#include "Shape.hpp"
+
+#include <vector>
+#include <glm/glm.hpp>
+
+
+namespace blank {
+
+class NullShape
+: public Shape {
+
+public:
+       NullShape();
+
+       bool Intersects(const Ray &, const glm::mat4 &, float &, glm::vec3 &) const noexcept override;
+
+};
+
+
+class CuboidShape
+: public Shape {
+
+public:
+       CuboidShape(const AABB &bounds);
+
+       bool Intersects(const Ray &, const glm::mat4 &, float &, glm::vec3 &) const noexcept override;
+
+private:
+       AABB bb;
+
+};
+
+
+class StairShape
+: public Shape {
+
+public:
+       StairShape(const AABB &bounds, const glm::vec2 &clip);
+
+       bool Intersects(const Ray &, const glm::mat4 &, float &, glm::vec3 &) const noexcept override;
+
+private:
+       AABB top, bot;
+
+};
+
+}
+
+#endif