From 86914985b77ddf5d6d3a3dd6c13deed9d906a471 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Wed, 7 Dec 2022 22:37:14 +0900 Subject: refactor: separate single main.zig --- src/rtw/hit_record.zig | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/rtw/hit_record.zig (limited to 'src/rtw/hit_record.zig') diff --git a/src/rtw/hit_record.zig b/src/rtw/hit_record.zig new file mode 100644 index 0000000..f71904e --- /dev/null +++ b/src/rtw/hit_record.zig @@ -0,0 +1,21 @@ +const vec = @import("vec.zig"); +const material = @import("material.zig"); +const Vec3 = vec.Vec3; +const Point3 = vec.Point3; +const Material = material.Material; + +pub const HitRecord = struct { + // The point where the ray and the hittable hits. + p: Point3, + // The normal of the hittable at p. + normal: Vec3, + // The material at p. + material: *const Material, + // p = ray.at(t) + t: f64, + // The coordinate of the surface where the ray intersects. + u: f64, + v: f64, + // True if the ray hits the hittable from the front face, i.e., outside of it. + front_face: bool, +}; -- cgit v1.2.3-70-g09d2