summaryrefslogtreecommitdiff
path: root/game/geoData.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-02-13 01:36:42 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2024-02-13 01:36:42 +0000
commit849f4aa735352704995ffb51bf23dadf795bb119 (patch)
tree6f610f55791d7dc7ade6ebf5be42227f63979f75 /game/geoData.h
parentAdd helpers for testing for triangle overlap/containedness (diff)
downloadilt-849f4aa735352704995ffb51bf23dadf795bb119.tar.bz2
ilt-849f4aa735352704995ffb51bf23dadf795bb119.tar.xz
ilt-849f4aa735352704995ffb51bf23dadf795bb119.zip
Include face handle in intersectRay result
Diffstat (limited to 'game/geoData.h')
-rw-r--r--game/geoData.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/game/geoData.h b/game/geoData.h
index 2fd3aa5..f599552 100644
--- a/game/geoData.h
+++ b/game/geoData.h
@@ -74,8 +74,10 @@ public:
[[nodiscard]] FaceHandle findPoint(GlobalPosition2D, FaceHandle start) const;
[[nodiscard]] GlobalPosition3D positionAt(const PointFace &) const;
- [[nodiscard]] std::optional<GlobalPosition3D> intersectRay(const Ray<GlobalPosition3D> &) const;
- [[nodiscard]] std::optional<GlobalPosition3D> intersectRay(const Ray<GlobalPosition3D> &, FaceHandle start) const;
+ using IntersectionLocation = std::pair<GlobalPosition3D, FaceHandle>;
+ using IntersectionResult = std::optional<IntersectionLocation>;
+ [[nodiscard]] IntersectionResult intersectRay(const Ray<GlobalPosition3D> &) const;
+ [[nodiscard]] IntersectionResult intersectRay(const Ray<GlobalPosition3D> &, FaceHandle start) const;
void walk(const PointFace & from, const GlobalPosition2D to, const std::function<void(FaceHandle)> & op) const;
void walkUntil(const PointFace & from, const GlobalPosition2D to, const std::function<bool(FaceHandle)> & op) const;