pub struct RawMeshData {
pub positions: Vec<[f32; 3]>,
pub normals: Vec<[f32; 3]>,
pub uvs: Vec<[f32; 2]>,
pub colors: Vec<[f32; 4]>,
pub indices: Vec<u32>,
pub texture_rgba: Vec<u8>,
pub texture_width: u32,
pub texture_height: u32,
}Expand description
Raw mesh data for custom use.
Fields§
§positions: Vec<[f32; 3]>Vertex positions (3 floats per vertex).
normals: Vec<[f32; 3]>Vertex normals (3 floats per vertex).
uvs: Vec<[f32; 2]>Texture coordinates (2 floats per vertex).
colors: Vec<[f32; 4]>Vertex colors (4 floats per vertex, RGBA).
indices: Vec<u32>Triangle indices (3 per triangle).
texture_rgba: Vec<u8>Texture atlas RGBA data.
texture_width: u32Texture atlas width.
texture_height: u32Texture atlas height.
Implementations§
Source§impl RawMeshData
impl RawMeshData
Sourcepub fn positions_flat(&self) -> Vec<f32>
pub fn positions_flat(&self) -> Vec<f32>
Get positions as a flat array.
Sourcepub fn normals_flat(&self) -> Vec<f32>
pub fn normals_flat(&self) -> Vec<f32>
Get normals as a flat array.
Sourcepub fn colors_flat(&self) -> Vec<f32>
pub fn colors_flat(&self) -> Vec<f32>
Get colors as a flat array.
Sourcepub fn vertex_count(&self) -> usize
pub fn vertex_count(&self) -> usize
Get the number of vertices.
Sourcepub fn triangle_count(&self) -> usize
pub fn triangle_count(&self) -> usize
Get the number of triangles.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RawMeshData
impl RefUnwindSafe for RawMeshData
impl Send for RawMeshData
impl Sync for RawMeshData
impl Unpin for RawMeshData
impl UnwindSafe for RawMeshData
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