pub struct ObjData {
pub position: Vec<[f32; 3]>,
pub texture: Vec<[f32; 2]>,
pub normal: Vec<[f32; 3]>,
pub objects: Vec<Object>,
pub material_libs: Vec<Mtl>,
}
Expand description
The data model associated with each Obj
file.
Fields§
§position: Vec<[f32; 3]>
Vertex positions.
texture: Vec<[f32; 2]>
2D texture coordinates.
normal: Vec<[f32; 3]>
A set of normals.
objects: Vec<Object>
A collection of associated objects indicated by o
, as well as the default object at the
top level.
material_libs: Vec<Mtl>
The set of all mtllib
references to .mtl files.
Implementations§
Source§impl ObjData
impl ObjData
Sourcepub fn save(&self, path: impl AsRef<Path>) -> Result<(), ObjError>
pub fn save(&self, path: impl AsRef<Path>) -> Result<(), ObjError>
Save the current ObjData
at the given file path as well as any associated .mtl files.
If a file already exists, it will be overwritten.
Sourcepub fn save_mtls(&self, base_dir: impl AsRef<Path>) -> Result<(), ObjError>
pub fn save_mtls(&self, base_dir: impl AsRef<Path>) -> Result<(), ObjError>
Save all material libraries referenced in this Obj
to the given base directory.
Trait Implementations§
impl StructuralPartialEq for ObjData
Auto Trait Implementations§
impl Freeze for ObjData
impl RefUnwindSafe for ObjData
impl Send for ObjData
impl Sync for ObjData
impl Unpin for ObjData
impl UnwindSafe for ObjData
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more