aboutsummaryrefslogtreecommitdiff
path: root/raytracing/src/ray.cc
diff options
context:
space:
mode:
authorRichard Qin <richard.qin.x@gmail.com>2026-03-09 23:31:27 +0800
committerRichard Qin <richard.qin.x@gmail.com>2026-03-09 23:31:27 +0800
commitd83cdc8de4d9160fd3eecae5af450aa26c2df154 (patch)
tree844256c199f816981ba0e2cd512436266240d8b2 /raytracing/src/ray.cc
parent99ac5b94e40b1b95be6ebc061f6dcee4d4dcfed5 (diff)
downloadrcc-project-d83cdc8de4d9160fd3eecae5af450aa26c2df154.tar.gz
rcc-project-d83cdc8de4d9160fd3eecae5af450aa26c2df154.tar.xz
Sending Rays Into the Scene
Diffstat (limited to 'raytracing/src/ray.cc')
-rw-r--r--raytracing/src/ray.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/raytracing/src/ray.cc b/raytracing/src/ray.cc
new file mode 100644
index 0000000..718fee2
--- /dev/null
+++ b/raytracing/src/ray.cc
@@ -0,0 +1,16 @@
+#include "ray.h"
+
+const point3& ray::origin() const
+{
+ return this->orig;
+}
+
+const vec3& ray::direction() const
+{
+ return this->dir;
+}
+
+point3 ray::at( double t ) const
+{
+ return this->orig + t * this->dir;
+} \ No newline at end of file