public static ModelReference CreateModelReference(IFile file) { var model = LoadModel(file); var reference = new ModelReference(file.FullPathName, model); References.Add(reference); return reference; }
private static void SetModel(Entity entity, ModelReference model) { entity.MetaData.Set(ModelMetaKey, model); entity.MetaData.Set(ModelNameMetaKey, GetModelName(entity)); entity.MetaData.Set(ModelBoundingBoxMetaKey, model.Model.GetBoundingBox()); entity.UpdateBoundingBox(); }
public static void DeleteModelReference(ModelReference reference) { References.Remove(reference); if (References.All(x => x.Model != reference.Model)) { UnloadModel(reference.Model); } }
public static ModelReference CreateModelReference(IFile file) { var model = LoadModel(file); var reference = new ModelReference(file.FullPathName, model); References.Add(reference); return(reference); }
public static void SetModel(this Entity entity, ModelReference model) { entity.MetaData.Set(ModelMetaKey, model); entity.MetaData.Set(ModelBoundingBoxMetaKey, (Box) null); //todo. }
private static void SetModel(Entity entity, ModelReference model) { entity.MetaData.Set(ModelMetaKey, model); entity.MetaData.Set(ModelNameMetaKey, GetModelName(entity)); entity.MetaData.Set(ModelBoundingBoxMetaKey, (Box) null); //todo. }