aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/rtw/ray.zig
blob: e46198f5f51a54159fb5f541d95a438837dd06bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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));
    }
};