From b222c21715384efc2eaa53d3ba295fb34da5b599 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 9 Apr 2023 12:24:55 +0100 Subject: Start to factor out geometric place from face controller split --- lib/geometricPlane.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 lib/geometricPlane.h (limited to 'lib/geometricPlane.h') diff --git a/lib/geometricPlane.h b/lib/geometricPlane.h new file mode 100644 index 0000000..96816f2 --- /dev/null +++ b/lib/geometricPlane.h @@ -0,0 +1,12 @@ +#pragma once + +#include + +class GeometricPlane { +public: + enum class PlaneRelation { Above, Below, On }; + + glm::vec3 origin, normal; + + PlaneRelation getRelation(glm::vec3 point) const; +}; -- cgit v1.2.3 From 560bfce98146895cfd8429150792d49a18e24d98 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 9 Apr 2023 13:15:46 +0100 Subject: Add lots of split required stuff to geometric plane --- lib/geometricPlane.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib/geometricPlane.h') diff --git a/lib/geometricPlane.h b/lib/geometricPlane.h index 96816f2..dc8df50 100644 --- a/lib/geometricPlane.h +++ b/lib/geometricPlane.h @@ -1,12 +1,22 @@ #pragma once #include +#include + +class Ray; class GeometricPlane { public: + struct DistAndPosition { + float dist; + glm::vec3 position; + }; enum class PlaneRelation { Above, Below, On }; glm::vec3 origin, normal; PlaneRelation getRelation(glm::vec3 point) const; + std::optional getRayIntersectPosition(const Ray &) const; + + static bool isIntersect(PlaneRelation a, PlaneRelation b); }; -- cgit v1.2.3