math: zig fmt
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
e1ce5c5662
commit
c03673ff05
2 changed files with 11 additions and 22 deletions
|
|
@ -362,7 +362,7 @@ pub fn Mat(
|
|||
|
||||
/// Matrix * Vector multiplication
|
||||
pub inline fn mulVec(matrix: *const Matrix, vector: *const ColVec) ColVec {
|
||||
var result = [_]ColVec.T{0}**ColVec.n;
|
||||
var result = [_]ColVec.T{0} ** ColVec.n;
|
||||
inline for (0..Matrix.rows) |row| {
|
||||
inline for (0..ColVec.n) |i| {
|
||||
result[i] += matrix.v[row].v[i] * vector.v[row];
|
||||
|
|
@ -371,7 +371,6 @@ pub fn Mat(
|
|||
return vec.Vec(ColVec.n, ColVec.T){ .v = result };
|
||||
}
|
||||
|
||||
|
||||
// TODO: the below code was correct in our old implementation, it just needs to be updated
|
||||
// to work with this new Mat approach, swapping f32 for the generic T float type, moving 3x3
|
||||
// and 4x4 specific functions into the mixin above, writing new tests, etc.
|
||||
|
|
@ -687,6 +686,3 @@ test "Mat4x4_mulVec_vec4" {
|
|||
const expected = math.vec4(4, 47, 5, 68);
|
||||
try testing.expect(math.Vec4, expected).eql(m);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue