Beispiel #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);
        }
Beispiel #2
0
 /// <summary>
 /// Returns a pointer to the static mesh
 /// </summary>
 public void GetMesh(uint modelId)
 {
     StaticMesh = StaticMeshCache.GetMesh(modelId);
 }
Beispiel #3
0
 /// <summary>
 /// Adds a static mesh to the cache
 /// </summary>
 public static void Add(uint id, StaticMesh mesh)
 {
     Meshes.Add(id, mesh);
 }