X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fmodel%2FShape.hpp;h=212e4393471b8335cabbe2df29a93be656f0a1c0;hb=32909aa3224ec0ed5656721178eb6ad31cd047df;hp=5d4036b6d30e925ab77c256f80326b1490b3853b;hpb=b7d09e1e35ef90282c97509e0020b20db3c7ea9f;p=blank.git diff --git a/src/model/Shape.hpp b/src/model/Shape.hpp index 5d4036b..212e439 100644 --- a/src/model/Shape.hpp +++ b/src/model/Shape.hpp @@ -11,6 +11,7 @@ namespace blank { +class AABB; class Ray; struct Shape { @@ -73,6 +74,16 @@ 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, + float &depth, + glm::vec3 &normal + ) const noexcept = 0; + protected: void SetShape(const Model::Positions &pos, const Model::Normals &nrm, const Model::Indices &idx) { vtx_pos = pos;