summaryrefslogtreecommitdiff
path: root/game/geoData.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2022-01-10 02:07:53 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2022-01-10 02:07:53 +0000
commit94f0e426bc8f298aec90fd0d4fcf6f823f8c399c (patch)
treec1be0231cab6f9680aa8c3f9e0acf531d8debb89 /game/geoData.h
parentTweak ray tracer calls to account for scale (diff)
downloadilt-94f0e426bc8f298aec90fd0d4fcf6f823f8c399c.tar.bz2
ilt-94f0e426bc8f298aec90fd0d4fcf6f823f8c399c.tar.xz
ilt-94f0e426bc8f298aec90fd0d4fcf6f823f8c399c.zip
Ray Trace cursor clicks to terrain surface
Diffstat (limited to 'game/geoData.h')
-rw-r--r--game/geoData.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/game/geoData.h b/game/geoData.h
index a296205..42c2d9d 100644
--- a/game/geoData.h
+++ b/game/geoData.h
@@ -2,10 +2,13 @@
#include <filesystem>
#include <glm/glm.hpp>
+#include <optional>
#include <span>
#include <utility>
#include <vector>
+class Ray;
+
class GeoData {
public:
struct Node {
@@ -22,6 +25,7 @@ public:
void loadFromImages(const std::filesystem::path &, float scale);
[[nodiscard]] glm::vec3 positionAt(glm::vec2) const;
+ [[nodiscard]] std::optional<glm::vec3> intersectRay(const Ray &) const;
[[nodiscard]] unsigned int at(glm::ivec2) const;
[[nodiscard]] unsigned int at(int x, int y) const;