X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fmodel%2Fshapes.hpp;fp=src%2Fmodel%2Fshapes.hpp;h=b5e965a1c8f1e2e302f2ae656397b631bac02c08;hb=b7d09e1e35ef90282c97509e0020b20db3c7ea9f;hp=0000000000000000000000000000000000000000;hpb=e53a0e2e711a7d8bd9b0ddacd1360aa14370643f;p=blank.git diff --git a/src/model/shapes.hpp b/src/model/shapes.hpp new file mode 100644 index 0000000..b5e965a --- /dev/null +++ b/src/model/shapes.hpp @@ -0,0 +1,53 @@ +#ifndef BLANK_MODEL_SHAPES_HPP_ +#define BLANK_MODEL_SHAPES_HPP_ + +#include "geometry.hpp" +#include "Shape.hpp" + +#include +#include + + +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