]> git.localhorst.tv Git - blank.git/blobdiff - src/model/Shape.hpp
plug box intersection into shapes
[blank.git] / src / model / Shape.hpp
index 5d4036b6d30e925ab77c256f80326b1490b3853b..39dd50f3b93048ad2edfe999113cf4e8fa4b13d5 100644 (file)
@@ -11,6 +11,7 @@
 
 namespace blank {
 
+class AABB;
 class Ray;
 
 struct Shape {
@@ -73,6 +74,14 @@ struct Shape {
                glm::vec3 &normal
        ) const noexcept = 0;
 
+       /// Check for intersection with given OBB.
+       /// The OBB is defined by box and box_M, M is applied to the shape.
+       virtual bool Intersects(
+               const glm::mat4 &M,
+               const AABB &box,
+               const glm::mat4 &box_M
+       ) const noexcept = 0;
+
 protected:
        void SetShape(const Model::Positions &pos, const Model::Normals &nrm, const Model::Indices &idx) {
                vtx_pos = pos;