pub struct Mesh {
pub vertices: Vec<f32>,
pub indices: Vec<u32>,
pub uvs: Vec<f32>,
pub origin: [f32; 2],
}Expand description
3D geometry of a visual node. Vertices and UVs are stored as flat arrays for efficiency.
Fields§
§vertices: Vec<f32>Vertex positions (flat array: [x1, y1, x2, y2, …]). Each pair = 2D coordinates of one vertex.
indices: Vec<u32>Triangle indices (triples of indices into vertices).
Defines which vertices form each triangle for render.
uvs: Vec<f32>UV coordinates (flat array: [u1, v1, u2, v2, …]). Texture mapping per vertex.
origin: [f32; 2]Origin/pivot point (x, y in pixels). Center of rotation and transform for the mesh.
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 UnsafeUnpin 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