pub struct ProceduralMesh {
pub vertices: Vec<[f32; 3]>,
pub normals: Vec<[f32; 3]>,
pub uvs: Vec<[f32; 2]>,
pub indices: Vec<u32>,
}Expand description
Engine-agnostic mesh container.
Vertices use a Y-up coordinate system: [x, y, z] where Y is the
world-space height sampled from the HeightMap.
Fields§
§vertices: Vec<[f32; 3]>Vertex positions as [x, y, z] (Y-up).
normals: Vec<[f32; 3]>Per-vertex normals (currently always [0, 1, 0] — flat upward).
uvs: Vec<[f32; 2]>Per-vertex texture coordinates [u, v].
indices: Vec<u32>Triangle indices into the vertex/normal/uv arrays.
Implementations§
Source§impl ProceduralMesh
impl ProceduralMesh
Sourcepub fn append(&mut self, other: &ProceduralMesh)
pub fn append(&mut self, other: &ProceduralMesh)
Merge another mesh into this one, offsetting indices.
Trait Implementations§
Source§impl Clone for ProceduralMesh
impl Clone for ProceduralMesh
Source§fn clone(&self) -> ProceduralMesh
fn clone(&self) -> ProceduralMesh
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ProceduralMesh
impl Debug for ProceduralMesh
Source§impl Default for ProceduralMesh
impl Default for ProceduralMesh
Source§fn default() -> ProceduralMesh
fn default() -> ProceduralMesh
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ProceduralMesh
impl RefUnwindSafe for ProceduralMesh
impl Send for ProceduralMesh
impl Sync for ProceduralMesh
impl Unpin for ProceduralMesh
impl UnsafeUnpin for ProceduralMesh
impl UnwindSafe for ProceduralMesh
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