diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-04-09 13:15:46 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-04-09 13:15:46 +0100 |
commit | 560bfce98146895cfd8429150792d49a18e24d98 (patch) | |
tree | b9ae5e5db2ec374658e7a5c95b8b88155406c344 /lib/geometricPlane.h | |
parent | Add helper to create a Ray from two points (diff) | |
download | ilt-560bfce98146895cfd8429150792d49a18e24d98.tar.bz2 ilt-560bfce98146895cfd8429150792d49a18e24d98.tar.xz ilt-560bfce98146895cfd8429150792d49a18e24d98.zip |
Add lots of split required stuff to geometric plane
Diffstat (limited to 'lib/geometricPlane.h')
-rw-r--r-- | lib/geometricPlane.h | 10 |
1 files changed, 10 insertions, 0 deletions
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 <glm/vec3.hpp> +#include <optional> + +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<DistAndPosition> getRayIntersectPosition(const Ray &) const; + + static bool isIntersect(PlaneRelation a, PlaneRelation b); }; |