diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-04-20 19:22:50 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-04-20 19:22:50 +0900 |
| commit | c64077509a2a5e7af8816653e4ea22c4bbeeaff2 (patch) | |
| tree | 14d7ae5fd968bd5cf8f804ff74a2e8660ee51eb4 /src/rtw | |
| parent | 42f06f1841d70a97bad48084cc3360209589196f (diff) | |
| download | RayTracingInOneWeekend.zig-c64077509a2a5e7af8816653e4ea22c4bbeeaff2.tar.gz RayTracingInOneWeekend.zig-c64077509a2a5e7af8816653e4ea22c4bbeeaff2.tar.zst RayTracingInOneWeekend.zig-c64077509a2a5e7af8816653e4ea22c4bbeeaff2.zip | |
feat: update zig to 0.14.0
Diffstat (limited to 'src/rtw')
| -rw-r--r-- | src/rtw/hittable.zig | 8 | ||||
| -rw-r--r-- | src/rtw/rand.zig | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/rtw/hittable.zig b/src/rtw/hittable.zig index c47d9ff..3816b4a 100644 --- a/src/rtw/hittable.zig +++ b/src/rtw/hittable.zig @@ -54,11 +54,11 @@ pub const Hittable = union(HittableTag) { return .{ .box = try Box.init(p0, p1, material, allocator) }; } - pub fn translate(obj: Rc(Self), offset: Vec3) Self { + pub fn makeTranslate(obj: Rc(Self), offset: Vec3) Self { return .{ .translate = .{ .object = obj, .offset = offset } }; } - pub fn rotateY(obj: Rc(Self), angle: f64) Self { + pub fn makeRotateY(obj: Rc(Self), angle: f64) Self { return .{ .rotateY = RotateY.init(obj, angle) }; } @@ -225,11 +225,11 @@ const MovingSphere = struct { const o0 = sphere.center(time0); const o1 = sphere.center(time1); const r = sphere.radius; - const box0 = .{ + const box0: Aabb = .{ .min = o0.sub(.{ .x = r, .y = r, .z = r }), .max = o0.add(.{ .x = r, .y = r, .z = r }), }; - const box1 = .{ + const box1: Aabb = .{ .min = o1.sub(.{ .x = r, .y = r, .z = r }), .max = o1.add(.{ .x = r, .y = r, .z = r }), }; diff --git a/src/rtw/rand.zig b/src/rtw/rand.zig index 47a8d61..dcc2aa1 100644 --- a/src/rtw/rand.zig +++ b/src/rtw/rand.zig @@ -2,7 +2,7 @@ const std = @import("std"); const Vec3 = @import("vec.zig").Vec3; -pub const Random = std.rand.Random; +pub const Random = std.Random; // [min, max) pub fn randomInt(comptime T: type, rand: Random, min: T, max: T) T { |
