Exemplo n.º 1
0
        /// <summary>
        /// Performs a cache lookup,
        /// adds a new static mesh if not found
        /// </summary>
        /// <param name="id">The model id to fetch the static mesh for</param>
        public static StaticMesh GetMesh(uint id)
        {
            StaticMesh mesh = null;

            Meshes.TryGetValue(id, out mesh);
            if (mesh == null)
            {
                mesh = new StaticMesh(id);
                Add(id, mesh);
            }
            return(mesh);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Returns a pointer to the static mesh
 /// </summary>
 public void GetMesh(uint modelId)
 {
     StaticMesh = StaticMeshCache.GetMesh(modelId);
 }
Exemplo n.º 3
0
 /// <summary>
 /// Adds a static mesh to the cache
 /// </summary>
 public static void Add(uint id, StaticMesh mesh)
 {
     Meshes.Add(id, mesh);
 }