aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/rtw/ray.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/rtw/ray.zig')
-rw-r--r--src/rtw/ray.zig13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/rtw/ray.zig b/src/rtw/ray.zig
new file mode 100644
index 0000000..e46198f
--- /dev/null
+++ b/src/rtw/ray.zig
@@ -0,0 +1,13 @@
+const vec = @import("vec.zig");
+const Vec3 = vec.Vec3;
+const Point3 = vec.Point3;
+
+pub const Ray = struct {
+ origin: Vec3,
+ dir: Vec3,
+ time: f64,
+
+ pub fn at(r: Ray, t: f64) Point3 {
+ return r.origin.add(r.dir.mul(t));
+ }
+};