Struct kiss3d::resource::MeshManager [−][src]
pub struct MeshManager { /* fields omitted */ }
The mesh manager.
Upon construction, it contains:
It keeps a cache of already-loaded meshes. Note that this is only a cache, nothing more. Thus, its usage is not required to load meshes.
Methods
impl MeshManager
[src]
impl MeshManager
pub fn new() -> MeshManager
[src]
pub fn new() -> MeshManager
Creates a new mesh manager.
pub fn get_global_manager<T, F: FnMut(&mut MeshManager) -> T>(f: F) -> T
[src]
pub fn get_global_manager<T, F: FnMut(&mut MeshManager) -> T>(f: F) -> T
Mutably applies a function to the mesh manager.
pub fn get(&mut self, name: &str) -> Option<Rc<RefCell<Mesh>>>
[src]
pub fn get(&mut self, name: &str) -> Option<Rc<RefCell<Mesh>>>
Get a mesh with the specified name. Returns None
if the mesh is not registered.
pub fn add(&mut self, mesh: Rc<RefCell<Mesh>>, name: &str)
[src]
pub fn add(&mut self, mesh: Rc<RefCell<Mesh>>, name: &str)
Adds a mesh with the specified name to this cache.
pub fn add_trimesh(
&mut self,
descr: TriMesh<f32>,
dynamic_draw: bool,
name: &str
) -> Rc<RefCell<Mesh>>
[src]
pub fn add_trimesh(
&mut self,
descr: TriMesh<f32>,
dynamic_draw: bool,
name: &str
) -> Rc<RefCell<Mesh>>
Adds a mesh with the specified mesh descriptor and name.
pub fn remove(&mut self, name: &str)
[src]
pub fn remove(&mut self, name: &str)
Removes a mesh from this cache.
pub fn load_obj(
path: &Path,
mtl_dir: &Path,
geometry_name: &str
) -> IoResult<Vec<(String, Rc<RefCell<Mesh>>, Option<MtlMaterial>)>>
[src]
pub fn load_obj(
path: &Path,
mtl_dir: &Path,
geometry_name: &str
) -> IoResult<Vec<(String, Rc<RefCell<Mesh>>, Option<MtlMaterial>)>>
Loads the meshes described by an obj file.
Auto Trait Implementations
impl !Send for MeshManager
impl !Send for MeshManager
impl !Sync for MeshManager
impl !Sync for MeshManager