summaryrefslogtreecommitdiff
path: root/game/geoData.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-11-04 17:07:58 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2023-11-04 19:09:26 +0000
commit5ed36466b48aa347277c70422eb00bee264a5c8b (patch)
tree313c4cde1ee4fe27a006815c858fd9bad88a876b /game/geoData.h
parentRename TerrainMesh to GeoData to drop inplace (diff)
downloadilt-5ed36466b48aa347277c70422eb00bee264a5c8b.tar.bz2
ilt-5ed36466b48aa347277c70422eb00bee264a5c8b.tar.xz
ilt-5ed36466b48aa347277c70422eb00bee264a5c8b.zip
Simplify some logic with the triangle construct
Diffstat (limited to 'game/geoData.h')
-rw-r--r--game/geoData.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/game/geoData.h b/game/geoData.h
index 3a4f98e..b8561d0 100644
--- a/game/geoData.h
+++ b/game/geoData.h
@@ -85,9 +85,15 @@ public:
}
protected:
- [[nodiscard]] static bool triangleContainsPoint(const glm::vec2, const glm::vec2, const glm::vec2, const glm::vec2);
+ template<glm::length_t Dim>
+ [[nodiscard]] Triangle<Dim>
+ triangle(FaceHandle f) const
+ {
+ return {this, fv_range(f)};
+ }
+
+ [[nodiscard]] static bool triangleContainsPoint(const glm::vec2, const Triangle<2> &);
[[nodiscard]] bool triangleContainsPoint(const glm::vec2, FaceHandle) const;
- [[nodiscard]] bool triangleContainsPoint(const glm::vec2, ConstFaceVertexIter) const;
private:
glm::vec3 lowerExtent {}, upperExtent {};