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]
fn new() -> MeshManager
Creates a new mesh manager.
fn get_global_manager<T, F: FnMut(&mut MeshManager) -> T>(f: F) -> T
Mutably applies a function to the mesh manager.
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.
fn add(&mut self, mesh: Rc<RefCell<Mesh>>, name: &str)
Adds a mesh with the specified name to this cache.
fn add_trimesh(&mut self,
descr: TriMesh3<f32>,
dynamic_draw: bool,
name: &str)
-> Rc<RefCell<Mesh>>
descr: TriMesh3<f32>,
dynamic_draw: bool,
name: &str)
-> Rc<RefCell<Mesh>>
Adds a mesh with the specified mesh descriptor and name.
fn remove(&mut self, name: &str)
Removes a mesh from this cache.
fn load_obj(path: &Path,
mtl_dir: &Path,
geometry_name: &str)
-> IoResult<Vec<(String, Rc<RefCell<Mesh>>, Option<MtlMaterial>)>>
mtl_dir: &Path,
geometry_name: &str)
-> IoResult<Vec<(String, Rc<RefCell<Mesh>>, Option<MtlMaterial>)>>
Loads the meshes described by an obj file.