math: add initial Quaternion implementation (#1000)

This commit is contained in:
Olle Lukowski 2023-09-15 19:38:46 +02:00 committed by GitHub
parent b7ad36078f
commit 93357bd358
Failed to generate hash of commit
2 changed files with 420 additions and 2 deletions

View file

@ -217,7 +217,7 @@ pub fn Vec(comptime n_value: usize, comptime Scalar: type) type {
/// Calculates the dot product between vector a and b and returns scalar.
pub inline fn dot(a: *const VecN, b: *const VecN) Scalar {
return .{ .v = @reduce(.Add, a.v * b.v) };
return @reduce(.Add, a.v * b.v);
}
};
}