[−][src]Struct wavefront::Obj
A struct representing the contents of a parsed OBJ file.
Implementations
impl Obj[src]
pub fn from_file<P: AsRef<Path>>(path: P) -> Result<Self, Error>[src]
Read an OBJ from a file.
pub fn from_reader<R: Read>(reader: R) -> Result<Self, Error>[src]
Read an OBJ from a reader (something implementing std::io::Read).
pub fn from_lines<I: Iterator<Item = L>, L: AsRef<str>>(
lines: I
) -> Result<Self, Error>[src]
lines: I
) -> Result<Self, Error>
Read an OBJ from an iterator over its lines.
pub fn positions(&self) -> &[[f32; 3]][src]
Returns a reference to the position attributes contained within this Obj.
pub fn uvs(&self) -> &[[f32; 3]][src]
Returns a reference to the texture coordinate attributes contained within this Obj.
pub fn normals(&self) -> &[[f32; 3]][src]
Returns a reference to the normal attributes contained within this Obj.
pub fn object(&self, name: &str) -> Option<Object<'_>>[src]
Returns a specific Object by name.
Note that if a name is not specified in the OBJ file, the name defaults to an empty string.
pub fn objects(
&self
) -> impl ExactSizeIterator<Item = (&String, Object<'_>)> + Clone + '_[src]
&self
) -> impl ExactSizeIterator<Item = (&String, Object<'_>)> + Clone + '_
pub fn groups(&self) -> impl Iterator<Item = (&String, Group<'_>)> + Clone + '_[src]
pub fn polygons(&self) -> impl Iterator<Item = Polygon<'_>> + Clone + '_[src]
pub fn triangles(&self) -> impl Iterator<Item = [Vertex<'_>; 3]> + Clone + '_[src]
Returns an iterator over the triangles in this Obj.
See Polygon::triangles for more information.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Obj
impl Send for Obj
impl Sync for Obj
impl Unpin for Obj
impl UnwindSafe for Obj
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,
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.
fn to_owned(&self) -> T[src]
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.
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>,