[−][src]Struct obj::ObjData
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
impl ObjData
[src]
pub fn save(&self, path: impl AsRef<Path>) -> Result<(), ObjError>
[src]
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.
pub fn save_mtls(&self, base_dir: impl AsRef<Path>) -> Result<(), ObjError>
[src]
Save all material libraries referenced in this Obj
to the given base directory.
pub fn save_mtls_with_fn<W: Write>(
&self,
base_dir: &Path,
resolve: impl FnMut(&Path, &str) -> Result<W>
) -> Result<(), ObjError>
[src]
&self,
base_dir: &Path,
resolve: impl FnMut(&Path, &str) -> Result<W>
) -> Result<(), ObjError>
Save all material libraries referenced in this Obj
struct according to resolve
.
pub fn write_to_buf(&self, out: &mut impl Write) -> Result<(), ObjError>
[src]
Serialize this Obj
into the given writer.
impl ObjData
[src]
pub fn load_buf<R: Read>(input: R) -> Result<Self, ObjError>
[src]
pub fn load_buf_with_config<R: Read>(
input: R,
config: LoadConfig
) -> Result<Self, ObjError>
[src]
input: R,
config: LoadConfig
) -> Result<Self, ObjError>
Trait Implementations
impl Clone for ObjData
[src]
impl Debug for ObjData
[src]
impl Default for ObjData
[src]
impl PartialEq<ObjData> for ObjData
[src]
impl StructuralPartialEq for ObjData
[src]
Auto Trait Implementations
impl RefUnwindSafe for ObjData
impl Send for ObjData
impl Sync for ObjData
impl Unpin for ObjData
impl UnwindSafe for ObjData
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,