4 using SiliconStudio.Core.Mathematics;
5 using SiliconStudio.Paradox.Effects.Modules;
7 namespace SiliconStudio.
Paradox.Effects
15 private static Matrix[] staticBoneMatrices;
19 var boneMatrices = staticBoneMatrices;
21 foreach (var meshes
in renderModel.RenderMeshes)
26 foreach (var renderMesh
in meshes)
28 var mesh = renderMesh.Mesh;
29 var skinning = mesh.Skinning;
33 var bones = skinning.Bones;
36 if (boneMatrices == null || bones.Length > boneMatrices.Length)
37 staticBoneMatrices = boneMatrices =
new Matrix[bones.Length];
39 for (
int index = 0; index < bones.Length; index++)
41 var nodeIndex = bones[index].NodeIndex;
44 Matrix.Multiply(ref bones[index].LinkToMeshMatrix, ref hierarchy.NodeTransformations[nodeIndex].WorldMatrix, out boneMatrices[index]);
48 renderMesh.Mesh.Parameters.Set(TransformationSkinningKeys.BlendMatrixArray, boneMatrices, 0, bones.Length);
Performs blend matrix skinning.
static void Update(ModelViewHierarchyUpdater hierarchy, RenderModel renderModel)
Instantiation of a Model through a RenderPipeline.
Performs hierarchical updates for a given Model.
Represents a 4x4 mathematical matrix.