about summary refs log tree commit diff
path: root/src/model.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/model.zig')
-rw-r--r--src/model.zig14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/model.zig b/src/model.zig
index 9773027..3acfe9d 100644
--- a/src/model.zig
+++ b/src/model.zig
@@ -1,6 +1,6 @@
 // 3D model
 // Copyright (C) 2002  David Rosen
-// Copyright (C) 2023  Nguyễn Gia Phong
+// Copyright (C) 2023, 2025  Nguyễn Gia Phong
 //
 // This file is part of Black Shades.
 //
@@ -25,7 +25,7 @@ const c = @import("cimport.zig");
 const crossProduct = geom.crossProduct;
 const cwd = std.fs.cwd;
 const data_dir = misc.data_dir;
-const degToRad = std.math.degreesToRadians;
+const degreesToRadians = std.math.degreesToRadians;
 const endsWith = std.mem.endsWith;
 const eql = std.mem.eql;
 const floatMax = std.math.floatMax;
@@ -63,7 +63,9 @@ const OffIterator = struct {
     token_iterator: TokenIterator,
 
     pub fn init(buffer: []const u8) OffIterator {
-        var self = .{ .token_iterator = tokenizeScalar(u8, buffer, '\n') };
+        var self = OffIterator{
+            .token_iterator = tokenizeScalar(u8, buffer, '\n'),
+        };
         if (!endsWith(u8, self.token_iterator.next().?, "OFF"))
             self.token_iterator.reset();
         return self;
@@ -198,12 +200,12 @@ pub export fn segCrossModelTrans(start: XYZ, end: XYZ, m: *const Model,
                                  intersection: *XYZ) c_int {
     const t: @Vector(3, f32) = @bitCast(move);
     var p = @as(@Vector(3, f32), @bitCast(start)) - t;
-    rotate2d(&p[2], &p[0], degToRad(f32, -rot));
+    rotate2d(&p[2], &p[0], degreesToRadians(-rot));
     var q = @as(@Vector(3, f32), @bitCast(end)) - t;
-    rotate2d(&q[2], &q[0], degToRad(f32, -rot));
+    rotate2d(&q[2], &q[0], degreesToRadians(-rot));
 
     defer {
-        rotate2d(&intersection.z, &intersection.x, degToRad(f32, rot));
+        rotate2d(&intersection.z, &intersection.x, degreesToRadians(rot));
         intersection.* = @bitCast(@as(@Vector(3, f32),
                                       @bitCast(intersection.*)) + t);
     }