From 5a0b3927a33807cca4c77c40eb873f8a3b51b0b0 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 29 Apr 2023 19:07:11 +0100 Subject: Drop .hpp for header only things Half of them acquired a .cpp part anyway --- lib/ray.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 lib/ray.h (limited to 'lib/ray.h') diff --git a/lib/ray.h b/lib/ray.h new file mode 100644 index 0000000..9bf47af --- /dev/null +++ b/lib/ray.h @@ -0,0 +1,17 @@ +#pragma once + +#include +#include + +class Ray { +public: + Ray(glm::vec3 start, glm::vec3 direction) : start {start}, direction {direction} { } + + static Ray fromPoints(glm::vec3, glm::vec3); + + glm::vec3 start; + glm::vec3 direction; + + float distanceToLine(const glm::vec3 & a, const glm::vec3 & b) const; + bool passesCloseToEdges(const std::span positions, float distance) const; +}; -- cgit v1.2.3