From d7f9a74f75ba0ce2167fa0e529a009becdcee7e3 Mon Sep 17 00:00:00 2001 From: Nguyễn Gia Phong Date: Sat, 25 Mar 2023 03:06:07 +0900 Subject: Convert a few linear algebra functions to Zig --- src/Decals.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/Decals.cpp') diff --git a/src/Decals.cpp b/src/Decals.cpp index 8a6ab5e..e5971e4 100644 --- a/src/Decals.cpp +++ b/src/Decals.cpp @@ -52,12 +52,11 @@ int Decals::MakeDecal(int atype, XYZ location, float size, XYZ normal, int poly, else if (major == 0) right = {normal.z, 0.0f, 0.0f}; } else { - CrossProduct(axis[major], normal, &right); + right = crossProduct(axis[major], normal); } - CrossProduct(normal, right, &up); - Normalise(&up); - Normalise(&right); + up = normalize(crossProduct(normal, right)); + right = normalize(right); float count; float count2; -- cgit 1.4.1