summaryrefslogtreecommitdiff
path: root/lib/geometricPlane.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-01-05 20:08:26 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2024-01-05 20:08:26 +0000
commit7ad46a0e239c7e68c4436e632a77a0d8a14b6333 (patch)
tree9cc27d180d6ef23dbdf655bf6f12a34bd5d0a7bf /lib/geometricPlane.cpp
parentRemove more use of legacy types and unnecessary pointers from selectable inte... (diff)
downloadilt-7ad46a0e239c7e68c4436e632a77a0d8a14b6333.tar.bz2
ilt-7ad46a0e239c7e68c4436e632a77a0d8a14b6333.tar.xz
ilt-7ad46a0e239c7e68c4436e632a77a0d8a14b6333.zip
Inline functions of GeometricPlane
Diffstat (limited to 'lib/geometricPlane.cpp')
-rw-r--r--lib/geometricPlane.cpp28
1 files changed, 0 insertions, 28 deletions
diff --git a/lib/geometricPlane.cpp b/lib/geometricPlane.cpp
deleted file mode 100644
index 567f98a..0000000
--- a/lib/geometricPlane.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-#include "geometricPlane.h"
-#include "ray.h"
-#include <glm/geometric.hpp>
-#include <glm/gtx/intersect.hpp>
-
-GeometricPlane::PlaneRelation
-GeometricPlane::getRelation(Position3D p) const
-{
- const auto d = glm::dot(normal, p - origin);
- return d < 0.F ? PlaneRelation::Below : d > 0.F ? PlaneRelation::Above : PlaneRelation::On;
-}
-
-bool
-GeometricPlane::isIntersect(PlaneRelation a, PlaneRelation b)
-{
- return ((a == PlaneRelation::Above && b == PlaneRelation::Below)
- || (a == PlaneRelation::Below && b == PlaneRelation::Above));
-}
-
-std::optional<GeometricPlane::DistAndPosition>
-GeometricPlane::getRayIntersectPosition(const Ray & ray) const
-{
- float dist {};
- if (!glm::intersectRayPlane(ray.start, ray.direction, origin, normal, dist)) {
- return {};
- }
- return DistAndPosition {dist, ray.start + (ray.direction * dist)};
-}