this repo has no description
1const zm = @import("zmath");
2
3const Ray = @This();
4
5orig: zm.Vec,
6dir: zm.Vec,
7tm: f32,
8
9pub fn init(origin: zm.Vec, direction: zm.Vec) Ray {
10 return Ray{
11 .orig = origin,
12 .dir = direction,
13 .tm = 0,
14 };
15}
16
17pub fn initT(origin: zm.Vec, direction: zm.Vec, tm: f32) Ray {
18 return Ray{
19 .orig = origin,
20 .dir = direction,
21 .tm = tm,
22 };
23}
24
25pub inline fn at(self: *Ray, t: f32) zm.Vec {
26 return self.orig + zm.f32x4s(t) * self.dir;
27}