summaryrefslogtreecommitdiff
path: root/lib/geometricPlane.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/geometricPlane.h')
-rw-r--r--lib/geometricPlane.h10
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);
};