summaryrefslogtreecommitdiff
path: root/game/terrain2.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-10-29 14:11:46 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2023-10-29 15:26:09 +0000
commit49a422ed91289a31142a8c0fb8b7030d2dea98a1 (patch)
tree9bdc69a8f6ee4cc6eda388eea6e0baa5606ff4b5 /game/terrain2.h
parentInitial OpenMesh based terrain data and tests (diff)
downloadilt-49a422ed91289a31142a8c0fb8b7030d2dea98a1.tar.bz2
ilt-49a422ed91289a31142a8c0fb8b7030d2dea98a1.tar.xz
ilt-49a422ed91289a31142a8c0fb8b7030d2dea98a1.zip
Initial commit of findPoint on terrain
2D navigate from a default/given starting point, possible scope for improvement, but it's not exactly slow; <9ms
Diffstat (limited to 'game/terrain2.h')
-rw-r--r--game/terrain2.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/game/terrain2.h b/game/terrain2.h
index d2da8d0..713fe23 100644
--- a/game/terrain2.h
+++ b/game/terrain2.h
@@ -18,7 +18,11 @@ class TerrainMesh : public OpenMesh::TriMesh_ArrayKernelT<TerrainTraits> {
public:
explicit TerrainMesh(const std::filesystem::path &);
+ [[nodiscard]] FaceHandle findPoint(glm::vec2) const;
+ [[nodiscard]] FaceHandle findPoint(glm::vec2, FaceHandle start) const;
+
protected:
[[nodiscard]] static bool triangleContainsPoint(const glm::vec2, const glm::vec2, const glm::vec2, const glm::vec2);
[[nodiscard]] bool triangleContainsPoint(const glm::vec2, FaceHandle) const;
+ [[nodiscard]] bool triangleContainsPoint(const glm::vec2, ConstFaceVertexIter) const;
};