(a: [[f32; 4]; 4], b: [[f32; 4]; 4])
| 72 | } |
| 73 | |
| 74 | pub fn mat4_multiply(a: [[f32; 4]; 4], b: [[f32; 4]; 4]) -> [[f32; 4]; 4] { |
| 75 | let mut out = [[0.0f32; 4]; 4]; |
| 76 | for col in 0..4 { |
| 77 | for row in 0..4 { |
| 78 | out[col][row] = a[0][row]*b[col][0] + a[1][row]*b[col][1] + a[2][row]*b[col][2] + a[3][row]*b[col][3]; |
| 79 | } |
| 80 | } |
| 81 | out |
| 82 | } |
| 83 | |
| 84 | /// Multiply a column-major 4x4 matrix by a column vector. |
| 85 | pub fn mat4_mul_vec4(m: &[[f32; 4]; 4], v: &[f32; 4]) -> [f32; 4] { |
no outgoing calls
no test coverage detected