(a: Mat4, b: Mat4)
| 183 | } |
| 184 | |
| 185 | export function mat4Multiply(a: Mat4, b: Mat4): Mat4 { |
| 186 | const out = new Array(16).fill(0); |
| 187 | for (let col = 0; col < 4; col++) { |
| 188 | for (let row = 0; row < 4; row++) { |
| 189 | out[col * 4 + row] = a[row] * b[col * 4] + a[4 + row] * b[col * 4 + 1] + |
| 190 | a[8 + row] * b[col * 4 + 2] + a[12 + row] * b[col * 4 + 3]; |
| 191 | } |
| 192 | } |
| 193 | return out; |
| 194 | } |
| 195 | |
| 196 | export function mat4Translate(m: Mat4, v: Vec3): Mat4 { |
| 197 | const out = [...m]; |
no outgoing calls
no test coverage detected