Something went wrong. Try again.
Something went wrong. Try again.
12345678910111213141516171819202122232425262728const zm = @import("zmath");
const Ray = @This();
orig: zm.Vec,dir: zm.Vec,tm: f32,
pub fn init(origin: zm.Vec, direction: zm.Vec) Ray { return Ray{ .orig = origin, .dir = direction, .tm = 0, };}
pub fn initT(origin: zm.Vec, direction: zm.Vec, tm: f32) Ray { return Ray{ .orig = origin, .dir = direction, .tm = tm, };}
pub inline fn at(self: *Ray, t: f32) zm.Vec { return self.orig + zm.f32x4s(t) * self.dir;}