summaryrefslogtreecommitdiff
path: root/lib/ray.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-01-01 17:56:26 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2024-01-01 17:56:26 +0000
commitd5cdbbf38380239524e351cb69aec94090884ca5 (patch)
tree5d7dff2f2775701069806eceb4eaef23b22eba3f /lib/ray.h
parentReformat with new clang-format (diff)
parentRemove more use of legacy types (diff)
downloadilt-d5cdbbf38380239524e351cb69aec94090884ca5.tar.bz2
ilt-d5cdbbf38380239524e351cb69aec94090884ca5.tar.xz
ilt-d5cdbbf38380239524e351cb69aec94090884ca5.zip
Merge remote-tracking branch 'origin/terrain'
Diffstat (limited to 'lib/ray.h')
-rw-r--r--lib/ray.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/ray.h b/lib/ray.h
index 9bf47af..bc70c74 100644
--- a/lib/ray.h
+++ b/lib/ray.h
@@ -1,17 +1,20 @@
#pragma once
+#include "config/types.h"
#include <glm/glm.hpp>
#include <span>
class Ray {
public:
- Ray(glm::vec3 start, glm::vec3 direction) : start {start}, direction {direction} { }
+#ifndef __cpp_aggregate_paren_init
+ Ray(Position3D start, Direction3D direction) : start {start}, direction {direction} { }
+#endif
- static Ray fromPoints(glm::vec3, glm::vec3);
+ static Ray fromPoints(Position3D, Position3D);
- glm::vec3 start;
- glm::vec3 direction;
+ Position3D start;
+ Direction3D direction;
- float distanceToLine(const glm::vec3 & a, const glm::vec3 & b) const;
- bool passesCloseToEdges(const std::span<const glm::vec3> positions, float distance) const;
+ [[nodiscard]] float distanceToLine(const Position3D & a, const Position3D & b) const;
+ [[nodiscard]] bool passesCloseToEdges(const std::span<const Position3D> positions, float distance) const;
};