summaryrefslogtreecommitdiff
path: root/lib/geometricPlane.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-04-09 12:24:55 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2023-04-09 12:24:55 +0100
commitb222c21715384efc2eaa53d3ba295fb34da5b599 (patch)
tree66149833358cbadb891159fd0faf74ef221e5073 /lib/geometricPlane.cpp
parentSimplify extruding (diff)
downloadilt-b222c21715384efc2eaa53d3ba295fb34da5b599.tar.bz2
ilt-b222c21715384efc2eaa53d3ba295fb34da5b599.tar.xz
ilt-b222c21715384efc2eaa53d3ba295fb34da5b599.zip
Start to factor out geometric place from face controller split
Diffstat (limited to 'lib/geometricPlane.cpp')
-rw-r--r--lib/geometricPlane.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/geometricPlane.cpp b/lib/geometricPlane.cpp
new file mode 100644
index 0000000..cb52997
--- /dev/null
+++ b/lib/geometricPlane.cpp
@@ -0,0 +1,9 @@
+#include "geometricPlane.h"
+#include <glm/geometric.hpp>
+
+GeometricPlane::PlaneRelation
+GeometricPlane::getRelation(glm::vec3 p) const
+{
+ const auto d = glm::dot(normal, p - origin);
+ return d < 0.f ? PlaneRelation::Below : d > 0.f ? PlaneRelation::Above : PlaneRelation::On;
+}