From 72e2df50a3d460cad047ad355cf3ae8626632437 Mon Sep 17 00:00:00 2001 From: RokKos Date: Thu, 29 Jun 2023 09:59:21 +0200 Subject: [PATCH] mach: math lib comment for cross product --- src/math.zig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/math.zig b/src/math.zig index 9a1a4568..de5adb37 100644 --- a/src/math.zig +++ b/src/math.zig @@ -132,6 +132,8 @@ pub const vec = struct { return (a * splat(@TypeOf(a), 1.0 - amount)) + (b * splat(@TypeOf(a), amount)); } + /// Calculates the cross product between vector a and b. This can be done only in 3D + /// and required inputs are Vec3. pub inline fn cross(a: Vec3, b: Vec3) Vec3 { // I am using build in operators * and - of @Vector that work with SIMD if possible // So I will first compute vector {y1*z2, z1*x2, x1*y2}