diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-01-07 13:23:27 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-01-07 13:23:27 +0000 |
commit | 108bf5b2424da06aa2e1735ffd10a2b713834db8 (patch) | |
tree | af0918a6a266aa7e6ee1d8129df6d5ef9fc4f8ab /lib/geometricPlane.cpp | |
parent | Remove more use of legacy types and unnecessary pointers from selectable inte... (diff) | |
parent | Remove Position3D from RailVehicle (diff) | |
download | ilt-108bf5b2424da06aa2e1735ffd10a2b713834db8.tar.bz2 ilt-108bf5b2424da06aa2e1735ffd10a2b713834db8.tar.xz ilt-108bf5b2424da06aa2e1735ffd10a2b713834db8.zip |
Merge branch 'template-types'
Diffstat (limited to 'lib/geometricPlane.cpp')
-rw-r--r-- | lib/geometricPlane.cpp | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/lib/geometricPlane.cpp b/lib/geometricPlane.cpp index 567f98a..7aadf6a 100644 --- a/lib/geometricPlane.cpp +++ b/lib/geometricPlane.cpp @@ -1,14 +1,4 @@ #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) @@ -16,13 +6,3 @@ 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)}; -} |