pub struct Mesh { /* private fields */ }
Expand description
The custom mesh type used internally by the Draw API.
Implementations§
source§impl Mesh
impl Mesh
sourcepub fn raw_vertex_count(&self) -> usize
pub fn raw_vertex_count(&self) -> usize
The number of raw vertices contained within the mesh.
sourcepub fn vertex_count(&self) -> usize
pub fn vertex_count(&self) -> usize
The number of vertices that would be yielded by a Vertices iterator for the given mesh.
sourcepub fn triangle_count(&self) -> usize
pub fn triangle_count(&self) -> usize
The number of triangles that would be yielded by a Triangles iterator for the given mesh.
sourcepub fn tex_coords(&self) -> &[TexCoords]
pub fn tex_coords(&self) -> &[TexCoords]
The Mesh’s vertex texture coordinates channel.
sourcepub fn push_vertex(&mut self, v: Vertex)
pub fn push_vertex(&mut self, v: Vertex)
Push the given vertex onto the inner channels.
sourcepub fn push_index(&mut self, i: u32)
pub fn push_index(&mut self, i: u32)
Push the given index onto the inner Indices channel.
sourcepub fn extend_vertices<I>(&mut self, vs: I)where
I: IntoIterator<Item = Vertex>,
pub fn extend_vertices<I>(&mut self, vs: I)where
I: IntoIterator<Item = Vertex>,
Extend the mesh channels with the given vertices.
sourcepub fn extend_indices<I>(&mut self, is: I)where
I: IntoIterator<Item = u32>,
pub fn extend_indices<I>(&mut self, is: I)where
I: IntoIterator<Item = u32>,
Extend the Mesh indices channel with the given indices.
sourcepub fn extend<V, I>(&mut self, vs: V, is: I)
pub fn extend<V, I>(&mut self, vs: V, is: I)
Extend the Mesh with the given vertices and indices.
sourcepub fn clear_vertices(&mut self)
pub fn clear_vertices(&mut self)
Clear all vertices from the mesh.
sourcepub fn clear_indices(&mut self)
pub fn clear_indices(&mut self)
Clear all indices from the mesh.
sourcepub fn raw_vertices(&self) -> RawVertices<&Self> ⓘ
pub fn raw_vertices(&self) -> RawVertices<&Self> ⓘ
Produce an iterator yielding all raw (non-index-order) vertices.
sourcepub fn into_raw_vertices(self) -> RawVertices<Self> ⓘ
pub fn into_raw_vertices(self) -> RawVertices<Self> ⓘ
Consume self and produce an iterator yielding all raw (non-index_order) vertices.
sourcepub fn extend_from_slices(
&mut self,
points: &[Point],
indices: &[u32],
colors: &[Color],
tex_coords: &[TexCoords]
)
pub fn extend_from_slices( &mut self, points: &[Point], indices: &[u32], colors: &[Color], tex_coords: &[TexCoords] )
Extend the mesh from the given slices.
This is faster than extend
which uses iteration internally.
**Panic!**s if the length of the given points, colors and tex_coords slices do not match.
sourcepub fn extend_vertices_from_slices(
&mut self,
points: &[Point],
colors: &[Color],
tex_coords: &[TexCoords]
)
pub fn extend_vertices_from_slices( &mut self, points: &[Point], colors: &[Color], tex_coords: &[TexCoords] )
Extend the mesh with the given slices of vertices.
sourcepub fn extend_indices_from_slice(&mut self, indices: &[u32])
pub fn extend_indices_from_slice(&mut self, indices: &[u32])
Extend the mesh with the given slices of vertices.
sourcepub fn vertices(&self) -> Vertices<&Self> ⓘ
pub fn vertices(&self) -> Vertices<&Self> ⓘ
Produce an iterator yielding all vertices in the order specified via the vertex indices.
sourcepub fn into_vertices(self) -> Vertices<Self> ⓘ
pub fn into_vertices(self) -> Vertices<Self> ⓘ
Consume self and produce an iterator yielding all vertices in index-order.
sourcepub fn into_triangles(self) -> Triangles<Self>
pub fn into_triangles(self) -> Triangles<Self>
Consume self and produce an iterator yielding all triangles.
Trait Implementations§
source§impl ClearIndices for Mesh
impl ClearIndices for Mesh
source§fn clear_indices(&mut self)
fn clear_indices(&mut self)
source§impl ClearVertices for Mesh
impl ClearVertices for Mesh
source§fn clear_vertices(&mut self)
fn clear_vertices(&mut self)
source§impl PushIndex for Mesh
impl PushIndex for Mesh
source§fn push_index(&mut self, index: Self::Index)
fn push_index(&mut self, index: Self::Index)
source§fn extend_indices<I>(&mut self, indices: I)where
I: IntoIterator<Item = Self::Index>,
fn extend_indices<I>(&mut self, indices: I)where
I: IntoIterator<Item = Self::Index>,
source§impl PushVertex<WithTexCoords<WithColor<Vec3>>> for Mesh
impl PushVertex<WithTexCoords<WithColor<Vec3>>> for Mesh
source§fn push_vertex(&mut self, v: Vertex)
fn push_vertex(&mut self, v: Vertex)
Auto Trait Implementations§
impl RefUnwindSafe for Mesh
impl Send for Mesh
impl Sync for Mesh
impl Unpin for Mesh
impl UnwindSafe for Mesh
Blanket Implementations§
source§impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
source§fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
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
source§impl<T> Clear for Twhere
T: ClearIndices + ClearVertices,
impl<T> Clear for Twhere
T: ClearIndices + ClearVertices,
source§impl<T, U> ConvertInto<U> for Twhere
U: ConvertFrom<T>,
impl<T, U> ConvertInto<U> for Twhere
U: ConvertFrom<T>,
source§fn convert_into(self) -> U
fn convert_into(self) -> U
source§fn convert_unclamped_into(self) -> U
fn convert_unclamped_into(self) -> U
source§fn try_convert_into(self) -> Result<U, OutOfBounds<U>>
fn try_convert_into(self) -> Result<U, OutOfBounds<U>>
OutOfBounds
error is returned which contains the unclamped color. Read more