From 893176a0b18a2281abe09def716ccc3db5583c3f Mon Sep 17 00:00:00 2001 From: Julian T Date: Sun, 26 Jul 2020 12:56:27 +0200 Subject: Implemented object intersection and startet work on render gui --- src/ray.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/ray.cpp (limited to 'src/ray.cpp') diff --git a/src/ray.cpp b/src/ray.cpp new file mode 100644 index 0000000..7bc6201 --- /dev/null +++ b/src/ray.cpp @@ -0,0 +1,17 @@ +#include "ray.hpp" + +Ray::Ray(Vec3d start, Vec3d direction, bool normalize) { + m_start = start; + m_direction = direction; + + if (normalize) { + m_direction.normalize(); + } +} + +Ray::Ray(Vec3d a, Vec3d b) { + m_start = a; + m_direction = b - a; + + m_direction.normalize(); +} -- cgit v1.2.3