MCPcopy
hub / github.com/g3n/engine / MultiplyMatrices

Method MultiplyMatrices

math32/matrix4.go:278–335  ·  view source on GitHub ↗

MultiplyMatrices computes a * b, storing the result in this matrix. Returns pointer to this updated matrix.

(a, b *Matrix4)

Source from the content-addressed store, hash-verified

276// MultiplyMatrices computes a * b, storing the result in this matrix.
277// Returns pointer to this updated matrix.
278func (m *Matrix4) MultiplyMatrices(a, b *Matrix4) *Matrix4 {
279
280 a11 := a[0]
281 a12 := a[4]
282 a13 := a[8]
283 a14 := a[12]
284 a21 := a[1]
285 a22 := a[5]
286 a23 := a[9]
287 a24 := a[13]
288 a31 := a[2]
289 a32 := a[6]
290 a33 := a[10]
291 a34 := a[14]
292 a41 := a[3]
293 a42 := a[7]
294 a43 := a[11]
295 a44 := a[15]
296
297 b11 := b[0]
298 b12 := b[4]
299 b13 := b[8]
300 b14 := b[12]
301 b21 := b[1]
302 b22 := b[5]
303 b23 := b[9]
304 b24 := b[13]
305 b31 := b[2]
306 b32 := b[6]
307 b33 := b[10]
308 b34 := b[14]
309 b41 := b[3]
310 b42 := b[7]
311 b43 := b[11]
312 b44 := b[15]
313
314 m[0] = a11*b11 + a12*b21 + a13*b31 + a14*b41
315 m[4] = a11*b12 + a12*b22 + a13*b32 + a14*b42
316 m[8] = a11*b13 + a12*b23 + a13*b33 + a14*b43
317 m[12] = a11*b14 + a12*b24 + a13*b34 + a14*b44
318
319 m[1] = a21*b11 + a22*b21 + a23*b31 + a24*b41
320 m[5] = a21*b12 + a22*b22 + a23*b32 + a24*b42
321 m[9] = a21*b13 + a22*b23 + a23*b33 + a24*b43
322 m[13] = a21*b14 + a22*b24 + a23*b34 + a24*b44
323
324 m[2] = a31*b11 + a32*b21 + a33*b31 + a34*b41
325 m[6] = a31*b12 + a32*b22 + a33*b32 + a34*b42
326 m[10] = a31*b13 + a32*b23 + a33*b33 + a34*b43
327 m[14] = a31*b14 + a32*b24 + a33*b34 + a34*b44
328
329 m[3] = a41*b11 + a42*b21 + a43*b31 + a44*b41
330 m[7] = a41*b12 + a42*b22 + a43*b32 + a44*b42
331 m[11] = a41*b13 + a42*b23 + a43*b33 + a44*b43
332 m[15] = a41*b14 + a42*b24 + a43*b34 + a44*b44
333
334 return m
335}

Callers 9

MultiplyMethod · 0.95
RenderSetupMethod · 0.95
RenderSetupMethod · 0.95
RenderMethod · 0.95
RaycastSpriteMethod · 0.95
CalculateMatricesMethod · 0.45
BoneMatricesMethod · 0.45
UpdateMatrixWorldMethod · 0.45
UpdateInertiaWorldMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected