MCPcopy Create free account
hub / github.com/Bloom-Engine/engine / mat4Multiply

Function mat4Multiply

src/math/index.ts:185–194  ·  view source on GitHub ↗
(a: Mat4, b: Mat4)

Source from the content-addressed store, hash-verified

183}
184
185export 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
196export function mat4Translate(m: Mat4, v: Vec3): Mat4 {
197 const out = [...m];

Callers 4

expandPrefabFunction · 0.90
mat4RotateXFunction · 0.85
mat4RotateYFunction · 0.85
mat4RotateZFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected