summaryrefslogtreecommitdiff
path: root/lib/geometricPlane.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-04-04 20:06:36 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2024-04-04 20:06:36 +0100
commit30b027f84772d4b1d18eebd03b83ce3a5966d5fe (patch)
treebf1f424ee3c92516d652934cf502ee06f60c57e5 /lib/geometricPlane.h
parentSimplify vector addition/subtraction with differnt types (diff)
parentRemove wireframe mode from test renders (diff)
downloadilt-30b027f84772d4b1d18eebd03b83ce3a5966d5fe.tar.bz2
ilt-30b027f84772d4b1d18eebd03b83ce3a5966d5fe.tar.xz
ilt-30b027f84772d4b1d18eebd03b83ce3a5966d5fe.zip
Merge remote-tracking branch 'origin/deform-terrain'
Two related issues remain: * Terrain self shadowing is common and handled poorly * Odd, but mathematically correct patterns/stripes in feature boundaries Neither of these relate directly to deformation.
Diffstat (limited to 'lib/geometricPlane.h')
-rw-r--r--lib/geometricPlane.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/geometricPlane.h b/lib/geometricPlane.h
index 3f95d3c..d4b803d 100644
--- a/lib/geometricPlane.h
+++ b/lib/geometricPlane.h
@@ -16,18 +16,22 @@ public:
template<typename PositionType> class GeometricPlaneT : public GeometricPlane {
public:
+ GeometricPlaneT() = default;
+
+ GeometricPlaneT(PositionType origin, Normal3D normal) : origin(std::move(origin)), normal(normal) { }
+
struct DistAndPosition {
PositionType::value_type dist;
PositionType position;
};
- PositionType origin;
- Normal3D normal;
+ PositionType origin {};
+ Normal3D normal {};
[[nodiscard]] inline PlaneRelation
getRelation(PositionType point) const
{
- const auto d = glm::dot(normal, point - origin);
+ const auto d = glm::dot(normal, RelativePosition3D(point - origin));
return d < 0.F ? PlaneRelation::Below : d > 0.F ? PlaneRelation::Above : PlaneRelation::On;
}