pub struct Mesh {
pub vertices: Vec<Vertex>,
pub indices: Vec<u32>,
}Fields§
§vertices: Vec<Vertex>§indices: Vec<u32>Implementations§
Source§impl Mesh
impl Mesh
pub fn validate(&self) -> Result<Bounds, MeshError>
pub fn triangle_count(&self) -> usize
Sourcepub fn cuboid(size: Vec3, color: Color) -> Mesh
pub fn cuboid(size: Vec3, color: Color) -> Mesh
Each face has its own vertices, preserving hard low-poly normals.
Sourcepub fn plane(width: f32, depth: f32, subdivisions: u16, color: Color) -> Mesh
pub fn plane(width: f32, depth: f32, subdivisions: u16, color: Color) -> Mesh
A subdivided XZ floor with normal +Y.
Sourcepub fn sphere(radius: f32, rings: u16, sectors: u16, color: Color) -> Mesh
pub fn sphere(radius: f32, rings: u16, sectors: u16, color: Color) -> Mesh
Faceted sphere. Duplicate per-triangle vertices keep normals flat.
Source§impl Mesh
impl Mesh
Sourcepub fn from_obj(source: &str, color: Color) -> Result<Mesh, ObjError>
pub fn from_obj(source: &str, color: Color) -> Result<Mesh, ObjError>
Bounded OBJ subset: positions, UVs/normals for index validation, and convex planar faces. Output deliberately uses flat generated normals and the supplied solid color.
pub fn from_obj_with_limits( source: &str, color: Color, limits: ObjLimits, ) -> Result<Mesh, ObjError>
Trait Implementations§
impl StructuralPartialEq for Mesh
Auto Trait Implementations§
impl Freeze for Mesh
impl RefUnwindSafe for Mesh
impl Send for Mesh
impl Sync for Mesh
impl Unpin for Mesh
impl UnwindSafe for Mesh
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more