Struct nobject_rs::Model

source ·
pub struct Model {
    pub vertices: Vec<Vertex>,
    pub normals: Vec<Normal>,
    pub textures: Vec<Texture>,
    pub faces: HashMap<String, Vec<Face>>,
    pub lines: HashMap<String, Vec<Line>>,
    pub points: HashMap<String, Vec<Point>>,
    pub groups: HashMap<String, Group>,
    pub material_libs: Vec<String>,
    pub texture_libs: Vec<String>,
    pub shadow_obj: Option<String>,
    pub trace_obj: Option<String>,
    /* private fields */
}
Expand description

This holds the end result of parsing an obj file. The default group for all models is “default”. That is to say, if no group is defined in a file, a “default” group will be used.

Everything will fall under the “default” group until another group is specified.

Fields§

§vertices: Vec<Vertex>

Collection of vertex data

§normals: Vec<Normal>§textures: Vec<Texture>

Collection of texture coordinate data

§faces: HashMap<String, Vec<Face>>

A map of group name to a collection of faces which belong to the group Everything will fall under the “default” group until another group is specified.

§lines: HashMap<String, Vec<Line>>

A map of group name to a collection of lines. Everything will fall under the “default” group until another group is specified.

§points: HashMap<String, Vec<Point>>

A map of group name to a collection of points. Everything will fall under the “default” group until another group is specified.

§groups: HashMap<String, Group>

A map of group name to the groups specific data. Everything will fall under the “default” group until another group is specified.

§material_libs: Vec<String>

The material library files to use with this obj.

§texture_libs: Vec<String>

The texture library files to use with this obj.

§shadow_obj: Option<String>

The file name for the shadow object

§trace_obj: Option<String>

The file name for the ray trace object

Trait Implementations§

source§

impl Clone for Model

source§

fn clone(&self) -> Model

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Model

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Model

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl From<(Vec<Vertex>, Vec<Normal>, Vec<Texture>, HashMap<String, Vec<Face>>, HashMap<String, Vec<Line>>, HashMap<String, Vec<Point>>, HashMap<String, Group>, Vec<String>, Vec<String>, Option<String>, Option<String>, Vec<String>, i32)> for Model

source§

fn from( original: (Vec<Vertex>, Vec<Normal>, Vec<Texture>, HashMap<String, Vec<Face>>, HashMap<String, Vec<Line>>, HashMap<String, Vec<Point>>, HashMap<String, Group>, Vec<String>, Vec<String>, Option<String>, Option<String>, Vec<String>, i32) ) -> Model

Converts to this type from the input type.
source§

impl From<Model> for (Vec<Vertex>, Vec<Normal>, Vec<Texture>, HashMap<String, Vec<Face>>, HashMap<String, Vec<Line>>, HashMap<String, Vec<Point>>, HashMap<String, Group>, Vec<String>, Vec<String>, Option<String>, Option<String>, Vec<String>, i32)

source§

fn from(original: Model) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze for Model

§

impl RefUnwindSafe for Model

§

impl Send for Model

§

impl Sync for Model

§

impl Unpin for Model

§

impl UnwindSafe for Model

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.