pub struct MeshData<'a, V> { /* private fields */ }
Expand description
A data struct for a mesh creation.
Implementations§
source§impl<'a, V> Data<'a, V>
impl<'a, V> Data<'a, V>
sourcepub fn new(verts: &'a [V], indxs: &'a [[u16; 3]]) -> Option<Self>
pub fn new(verts: &'a [V], indxs: &'a [[u16; 3]]) -> Option<Self>
Creates a new MeshData
from given vertices and indices.
Returns Some
if a data length fits in u16
and all indices point to the data,
otherwise returns None
.
sourcepub fn from_triangles(verts: &'a [V]) -> Option<Self>
pub fn from_triangles(verts: &'a [V]) -> Option<Self>
Creates a new MeshData
from given triangles.
Returns Some
if a data length fits in u16
and is multiple by 3,
otherwise returns None
.
sourcepub fn from_quads(verts: &'a [V]) -> Option<Self>
pub fn from_quads(verts: &'a [V]) -> Option<Self>
Creates a new MeshData
from given quadrangles.
Returns Some
if a data length fits in u16
and is multiple by 4,
otherwise returns None
.