MCPcopy Index your code
hub / github.com/g3n/engine / BoneMatrices

Method BoneMatrices

graphic/skeleton.go:50–60  ·  view source on GitHub ↗

BoneMatrices calculates and returns the bone world matrices to be sent to the shader.

(invMat *math32.Matrix4)

Source from the content-addressed store, hash-verified

48
49// BoneMatrices calculates and returns the bone world matrices to be sent to the shader.
50func (sk *Skeleton) BoneMatrices(invMat *math32.Matrix4) []math32.Matrix4 {
51
52 // Update bone matrices based on inverseBindMatrices and the provided invMat
53 for i := range sk.bones {
54 bMat := sk.bones[i].MatrixWorld()
55 bMat.MultiplyMatrices(&bMat, &sk.inverseBindMatrices[i])
56 sk.boneMatrices[i].MultiplyMatrices(invMat, &bMat)
57 }
58
59 return sk.boneMatrices
60}

Callers 1

RenderSetupMethod · 0.80

Calls 2

MatrixWorldMethod · 0.80
MultiplyMatricesMethod · 0.45

Tested by

no test coverage detected