pub struct MeshData {
pub positions: Vec<Vec3>,
pub normals: Option<Vec<Vec3>>,
pub texcoords: Option<Vec<Vec2>>,
pub colors: Option<Vec<[u8; 4]>>,
pub indices: Option<Vec<u16>>,
}Expand description
Owned CPU mesh data. Safe to build on a worker and send to the render thread.
Triangles use counterclockwise winding when viewed from the front. With no indices, each consecutive three positions form a triangle. Optional vertex attributes must contain one element per position. Missing UVs use zero; missing colors use white. Normals are optional and are not generated.
Fields§
§positions: Vec<Vec3>Local-space vertex positions.
normals: Option<Vec<Vec3>>Optional local-space normals, usually unit vectors.
texcoords: Option<Vec<Vec2>>Optional texture coordinates. Values outside 0..1 are allowed.
colors: Option<Vec<[u8; 4]>>Optional RGBA vertex colors, with components in 0..=255.
indices: Option<Vec<u16>>Optional triangle indices, three per triangle.
Implementations§
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