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