pub struct MeshData {
pub positions: Vec<f32>,
pub normals: Vec<f32>,
pub indices: Vec<u32>,
}Expand description
GPU-ready mesh data
Contains flattened vertex data suitable for GPU rendering.
Fields§
§positions: Vec<f32>Vertex positions as flattened [x, y, z, x, y, z, …]
normals: Vec<f32>Vertex normals as flattened [nx, ny, nz, nx, ny, nz, …]
indices: Vec<u32>Triangle indices
Implementations§
Source§impl MeshData
impl MeshData
Sourcepub fn with_capacity(vertex_count: usize, index_count: usize) -> Self
pub fn with_capacity(vertex_count: usize, index_count: usize) -> Self
Create mesh with pre-allocated capacity
Sourcepub fn vertex_count(&self) -> usize
pub fn vertex_count(&self) -> usize
Get vertex count
Sourcepub fn triangle_count(&self) -> usize
pub fn triangle_count(&self) -> usize
Get triangle count
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MeshData
impl RefUnwindSafe for MeshData
impl Send for MeshData
impl Sync for MeshData
impl Unpin for MeshData
impl UnsafeUnpin for MeshData
impl UnwindSafe for MeshData
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