#[derive(Clone, Debug)]
pub struct ObjSet {
pub material_library: Option<String>,
pub objects: Vec<Object>,
}
#[derive(Clone, Debug)]
pub struct Object {
pub id: String,
pub name: String,
pub vertices: Vec<Vertex>,
pub joint_weights: Vec<JointWeights>,
pub tex_vertices: Vec<TVertex>,
pub normals: Vec<Normal>,
pub geometry: Vec<Geometry>,
}
#[derive(Clone, Debug)]
pub struct Geometry {
pub smooth_shading_group: usize,
pub mesh: Vec<PrimitiveElement>,
}
#[derive(Clone, Debug)]
pub struct Triangles {
pub vertices: Vec<(VertexIndex, VertexIndex, VertexIndex)>,
pub tex_vertices: Option<Vec<(TextureIndex, TextureIndex, TextureIndex)>>,
pub normals: Option<Vec<(NormalIndex, NormalIndex, NormalIndex)>>,
pub material: Option<String>,
}
#[derive(Clone, Copy, Debug, Hash)]
pub enum Shape {
Point(VTNIndex),
Line(VTNIndex, VTNIndex),
Triangle(VTNIndex, VTNIndex, VTNIndex),
}
#[derive(Clone, Debug)]
pub struct Polylist {
pub shapes: Vec<Shape>,
pub material: Option<String>,
}
#[derive(Clone, Debug)]
pub enum PrimitiveElement {
Polylist(Polylist),
Triangles(Triangles),
}
#[allow(missing_docs)]
#[derive(Clone, Copy, Debug)]
pub struct Vertex {
pub x: f64,
pub y: f64,
pub z: f64,
}
#[derive(Clone, Copy, Debug)]
pub struct JointWeights {
pub joints: [usize; 4],
pub weights: [f32; 4],
}
pub type Normal = Vertex;
#[allow(missing_docs)]
#[derive(Clone, Copy, Debug)]
pub struct TVertex {
pub x: f64,
pub y: f64,
}
pub type VertexIndex = usize;
pub type TextureIndex = usize;
pub type NormalIndex = usize;
pub type VTNIndex = (VertexIndex, Option<TextureIndex>, Option<NormalIndex>);