X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fmodel%2Fshape.cpp;h=82659437f60fc87506f3847e181494514a99a7cd;hb=bc1cefd505bf1f34639b8839cb337b08310ceb8e;hp=1c831498e6e36a16cd6d1710c806405f7ca6c076;hpb=0580ff3941fe5f5ea25c96e737edba1541d9271f;p=blank.git diff --git a/src/model/shape.cpp b/src/model/shape.cpp index 1c83149..8265943 100644 --- a/src/model/shape.cpp +++ b/src/model/shape.cpp @@ -80,6 +80,14 @@ bool NullShape::Intersects( return false; } +bool NullShape::Intersects( + const glm::mat4 &, + const AABB &, + const glm::mat4 & +) const noexcept { + return false; +} + CuboidShape::CuboidShape(const AABB &b) : Shape() @@ -167,6 +175,14 @@ bool CuboidShape::Intersects( return Intersection(ray, bb, M, &dist, &normal); } +bool CuboidShape::Intersects( + const glm::mat4 &M, + const AABB &box, + const glm::mat4 &box_M +) const noexcept { + return Intersection(bb, M, box, box_M); +} + StairShape::StairShape(const AABB &bb, const glm::vec2 &clip) : Shape() @@ -326,4 +342,12 @@ bool StairShape::Intersects( } } +bool StairShape::Intersects( + const glm::mat4 &M, + const AABB &box, + const glm::mat4 &box_M +) const noexcept { + return Intersection(bot, M, box, box_M) || Intersection(top, M, box, box_M); +} + }