aboutsummaryrefslogtreecommitdiffstats
path: root/src/ray.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ray.cpp')
-rw-r--r--src/ray.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/ray.cpp b/src/ray.cpp
new file mode 100644
index 0000000..2d479b7
--- /dev/null
+++ b/src/ray.cpp
@@ -0,0 +1,8 @@
+#include "ray.hpp"
+
+ray::ray(const point3& origin, const vec3& direction): origin(origin), direction(direction)
+{}
+
+point3 ray::at(double t) {
+ return origin + direction * t;
+}