From 7ad46a0e239c7e68c4436e632a77a0d8a14b6333 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Fri, 5 Jan 2024 20:08:26 +0000 Subject: Inline functions of GeometricPlane --- lib/geometricPlane.cpp | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 lib/geometricPlane.cpp (limited to 'lib/geometricPlane.cpp') 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 -#include - -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::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)}; -} -- cgit v1.2.3