Exemplo n.º 1
0
            private void ModelUpdated()
            {
                if (model != null)
                {
                    // Create mesh-per-entity state
                    meshInfos.Clear();
                    foreach (var mesh in model.Meshes)
                    {
                        var meshData = new MeshInfo();
                        meshInfos.Add(meshData);

                        if (mesh.Skinning != null)
                        {
                            meshData.BlendMatrices = new Matrix[mesh.Skinning.Bones.Length];
                        }
                    }

                    if (skeleton != null)
                    {
                        // Reuse previous ModelViewHierarchy
                        skeleton.Initialize(model.Skeleton);
                    }
                    else
                    {
                        skeleton = new SkeletonUpdater(model.Skeleton);
                    }
                }
            }
Exemplo n.º 2
0
 private void ModelUpdated()
 {
     if (model != null)
     {
         if (skeleton != null)
         {
             // Reuse previous ModelViewHierarchy
             skeleton.Initialize(model.Skeleton);
         }
         else
         {
             skeleton = new SkeletonUpdater(model.Skeleton);
         }
     }
 }