Ejemplo n.º 1
0
        /// <summary>
        /// Get the cache entry corresponding to a mesh.
        ///
        /// Creates an entry if it does not exist yet.
        /// </summary>
        /// <param name="mesh"></param>
        /// <returns></returns>
        public CachedMeshData GetEntry(D3DMesh mesh)
        {
            CachedMeshData entry;

            if (_cache.TryGetValue(mesh, out entry) && entry.CompatibleWith(mesh))
            {
                return(entry);
            }
            return(_cache[mesh] = new CachedMeshData(_owner, mesh));
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Constructs a CpuSkinningEvaluator for a given scene.
 /// </summary>
 /// <param name="owner"></param>
 public CpuSkinningEvaluator(Scene owner)
 {
     _owner = owner;
     _cache = new CachedMeshData[owner.Raw.MeshCount];
     for (var i = 0; i < _cache.Length; ++i)
     {
         if (!owner.Raw.Meshes[i].HasBones)
         {
             continue;
         }
         _cache[i] = new CachedMeshData(owner, owner.Raw.Meshes[i]);
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Constructs a CpuSkinningEvaluator for a given scene.
 /// </summary>
 /// <param name="owner"></param>
 public CpuSkinningEvaluator(Scene owner)
 {
     _owner = owner;
     _cache = new Dictionary <Mesh, CachedMeshData>();
     for (var i = 0; i < owner.Raw.Meshes.Count; ++i)
     {
         var mesh = owner.Raw.Meshes[i];
         if (!mesh.HasBones)
         {
             continue;
         }
         _cache[mesh] = new CachedMeshData(owner, mesh);
     }
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Constructs a CpuSkinningEvaluator for a given scene.
 /// </summary>
 /// <param name="owner"></param>
 public CpuSkinningEvaluator(Scene owner)
 {
     _owner = owner;
     _cache = new Dictionary <D3DMesh, CachedMeshData>();
     // for (var i = 0; i < owner.Raw.Meshes.Count; ++i)
     for (var i = 0; i < owner.Children.Count; ++i)
     {
         D3DMesh mesh = owner.Children[i] as D3DMesh;
         if (!mesh.HasBones)
         {
             continue;
         }
         _cache[mesh] = new CachedMeshData(owner, mesh);
     }
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Get the cache entry corresponding to a mesh.
 /// 
 /// Creates an entry if it does not exist yet.
 /// </summary>
 /// <param name="mesh"></param>
 /// <returns></returns>
 private CachedMeshData GetEntry(Mesh mesh)
 {
     CachedMeshData entry;
     if (_cache.TryGetValue(mesh, out entry) && entry.CompatibleWith(mesh))
     {
         return entry;
     }
     return _cache[mesh] = new CachedMeshData(_owner, mesh);
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Constructs a CpuSkinningEvaluator for a given scene.
 /// </summary>
 /// <param name="owner"></param>
 public CpuSkinningEvaluator(Scene owner)
 {
     _owner = owner;
     _cache = new Dictionary<Mesh, CachedMeshData>();
     for (var i = 0; i < owner.Raw.Meshes.Count; ++i)
     {
         var mesh = owner.Raw.Meshes[i];
         if (!mesh.HasBones)
         {
             continue;
         }
         _cache[mesh] = new CachedMeshData(owner, mesh);
     }
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Constructs a CpuSkinningEvaluator for a given scene.
 /// </summary>
 /// <param name="owner"></param>
 public CpuSkinningEvaluator(Scene owner)
 {
     _owner = owner;
     _cache = new CachedMeshData[owner.Raw.MeshCount];
     for (var i = 0; i < _cache.Length; ++i)
     {
         if (!owner.Raw.Meshes[i].HasBones)
         {
             continue;
         }
         _cache[i] = new CachedMeshData(owner, owner.Raw.Meshes[i]);
     }
 }