aboutsummaryrefslogtreecommitdiff
path: root/src/core/ray.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/ray.cpp')
-rw-r--r--src/core/ray.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/core/ray.cpp b/src/core/ray.cpp
new file mode 100644
index 0000000..7bc6201
--- /dev/null
+++ b/src/core/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();
+}