BoneMatrices calculates and returns the bone world matrices to be sent to the shader.
(invMat *math32.Matrix4)
| 48 | |
| 49 | // BoneMatrices calculates and returns the bone world matrices to be sent to the shader. |
| 50 | func (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 | } |
no test coverage detected