pub struct Mesh {
pub vertices: Vec<f32>,
pub indices: Vec<u16>,
}Expand description
Simple mesh data to be consumed by the vertex shader.
verticesis a flat list off32vertex attributes (e.g. position, uv, etc.).indicesdescribes element indices (u16) for indexed drawing.
Fields§
§vertices: Vec<f32>§indices: Vec<u16>Implementations§
Source§impl Mesh
impl Mesh
Sourcepub fn new(vertices: Vec<f32>, indices: Vec<u16>) -> Self
pub fn new(vertices: Vec<f32>, indices: Vec<u16>) -> Self
Create a new mesh from raw vertex and index arrays.
Sourcepub fn vertex_count(&self) -> usize
pub fn vertex_count(&self) -> usize
Number of vertices (interpreted as count of attribute groups should be computed by caller).
Sourcepub fn index_count(&self) -> usize
pub fn index_count(&self) -> usize
Number of indices for indexed drawing.
Trait Implementations§
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