summaryrefslogtreecommitdiff
path: root/lib/ray.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-11-07 02:51:42 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2023-11-07 02:51:42 +0000
commitd6e99a696aa582b81018078b68f6600c8030d643 (patch)
tree5c1451bbc76c31f78ddd169fca7780a0943f5910 /lib/ray.h
parentReformat with new clang-format (diff)
downloadilt-d6e99a696aa582b81018078b68f6600c8030d643.tar.bz2
ilt-d6e99a696aa582b81018078b68f6600c8030d643.tar.xz
ilt-d6e99a696aa582b81018078b68f6600c8030d643.zip
WIP typedefing all the things - headers
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;
};