Struct obj::Obj [−][src]
pub struct Obj<'a, P> where
P: 'a + GenPolygon, { pub position: Vec<[f32; 3]>, pub texture: Vec<[f32; 2]>, pub normal: Vec<[f32; 3]>, pub objects: Vec<Object<'a, P>>, pub material_libs: Vec<String>, pub path: PathBuf, }
Fields
position: Vec<[f32; 3]>
texture: Vec<[f32; 2]>
normal: Vec<[f32; 3]>
objects: Vec<Object<'a, P>>
material_libs: Vec<String>
path: PathBuf
Methods
impl<'a, P> Obj<'a, P> where
P: GenPolygon,
[src]
impl<'a, P> Obj<'a, P> where
P: GenPolygon,
pub fn load(path: &Path) -> Result<Obj<P>>
[src]
pub fn load(path: &Path) -> Result<Obj<P>>
pub fn load_mtls(&mut self) -> Result<(), Vec<(String, Error)>>
[src]
pub fn load_mtls(&mut self) -> Result<(), Vec<(String, Error)>>
Loads the .mtl files referenced in the .obj file.
If it encounters an error for an .mtl, it appends its error to the returning Vec, and tries the rest.
The Result Err value format is a Vec, which items are tuples with first index being the the .mtl file and the second its corresponding error.
pub fn load_buf<B>(input: &mut B) -> Result<Self> where
B: BufRead,
[src]
pub fn load_buf<B>(input: &mut B) -> Result<Self> where
B: BufRead,