Struct nannou::draw::mesh::Mesh

source ·
pub struct Mesh { /* private fields */ }
Expand description

The custom mesh type used internally by the Draw API.

Implementations§

source§

impl Mesh

source

pub fn raw_vertex_count(&self) -> usize

The number of raw vertices contained within the mesh.

source

pub fn vertex_count(&self) -> usize

The number of vertices that would be yielded by a Vertices iterator for the given mesh.

source

pub fn triangle_count(&self) -> usize

The number of triangles that would be yielded by a Triangles iterator for the given mesh.

source

pub fn points(&self) -> &[Point]

The Mesh’s vertex position channel.

source

pub fn indices(&self) -> &[u32]

The Mesh’s vertex indices channel.

source

pub fn colors(&self) -> &[Color]

The Mesh’s vertex colors channel.

source

pub fn tex_coords(&self) -> &[TexCoords]

The Mesh’s vertex texture coordinates channel.

source

pub fn push_vertex(&mut self, v: Vertex)

Push the given vertex onto the inner channels.

source

pub fn push_index(&mut self, i: u32)

Push the given index onto the inner Indices channel.

source

pub fn extend_vertices<I>(&mut self, vs: I)
where I: IntoIterator<Item = Vertex>,

Extend the mesh channels with the given vertices.

source

pub fn extend_indices<I>(&mut self, is: I)
where I: IntoIterator<Item = u32>,

Extend the Mesh indices channel with the given indices.

source

pub fn extend<V, I>(&mut self, vs: V, is: I)
where V: IntoIterator<Item = Vertex>, I: IntoIterator<Item = u32>,

Extend the Mesh with the given vertices and indices.

source

pub fn clear_vertices(&mut self)

Clear all vertices from the mesh.

source

pub fn clear_indices(&mut self)

Clear all indices from the mesh.

source

pub fn clear(&mut self)

Clear all vertices and indices from the mesh.

source

pub fn raw_vertices(&self) -> RawVertices<&Self>

Produce an iterator yielding all raw (non-index-order) vertices.

source

pub fn into_raw_vertices(self) -> RawVertices<Self>

Consume self and produce an iterator yielding all raw (non-index_order) vertices.

source

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.

source

pub fn extend_vertices_from_slices( &mut self, points: &[Point], colors: &[Color], tex_coords: &[TexCoords] )

Extend the mesh with the given slices of vertices.

source

pub fn extend_indices_from_slice(&mut self, indices: &[u32])

Extend the mesh with the given slices of vertices.

source

pub fn vertices(&self) -> Vertices<&Self>

Produce an iterator yielding all vertices in the order specified via the vertex indices.

source

pub fn triangles(&self) -> Triangles<&Self>

Produce an iterator yielding all triangles.

source

pub fn into_vertices(self) -> Vertices<Self>

Consume self and produce an iterator yielding all vertices in index-order.

source

pub fn into_triangles(self) -> Triangles<Self>

Consume self and produce an iterator yielding all triangles.

Trait Implementations§

source§

impl ClearIndices for Mesh

source§

fn clear_indices(&mut self)

Clear all indices from the mesh.
source§

impl ClearVertices for Mesh

source§

fn clear_vertices(&mut self)

Clear all vertices from the mesh.
source§

impl Clone for Mesh

source§

fn clone(&self) -> Mesh

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Colors for Mesh

§

type Color = Alpha<Rgb<Linear<Srgb>>, f32>

The color type stored within the channel.
§

type Colors = Vec<Alpha<Rgb<Linear<Srgb>>, f32>>

The channel type containing colors.
source§

fn colors(&self) -> &Self::Colors

Borrow the color channel from the mesh.
source§

impl Debug for Mesh

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Mesh

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Deref for Mesh

§

type Target = WithTexCoords<WithColors<WithIndices<MeshPoints<Vec<Vec3>>, Vec<u32>>, Vec<Alpha<Rgb<Linear<Srgb>>, f32>>>, Vec<Vec2>>

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl DerefMut for Mesh

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl GetVertex<u32> for Mesh

§

type Vertex = WithTexCoords<WithColor<Vec3>>

The vertex type representing all channels of data within the mesh at a single index.
source§

fn get_vertex(&self, index: u32) -> Option<Self::Vertex>

Create a vertex containing all channel properties for the given index.
source§

impl Indices for Mesh

§

type Index = u32

The type used to index into the vertex buffer.
§

type Indices = Vec<u32>

The channel type containing indices.
source§

fn indices(&self) -> &Self::Indices

Borrow the index channel from the mesh.
source§

impl Points for Mesh

§

type Point = Vec3

The vertex type used to represent the location of a vertex.
§

type Points = Vec<Vec3>

The channel type containing points.
source§

fn points(&self) -> &Self::Points

Borrow the vertex channel from the mesh.
source§

impl PushIndex for Mesh

§

type Index = u32

The inner index type.
source§

fn push_index(&mut self, index: Self::Index)

Push a new index onto the indices channel.
source§

fn extend_indices<I>(&mut self, indices: I)
where I: IntoIterator<Item = Self::Index>,

Extend the Mesh’s Indices channel with the given indices.
source§

impl PushVertex<WithTexCoords<WithColor<Vec3>>> for Mesh

source§

fn push_vertex(&mut self, v: Vertex)

Push the given vertex onto the mesh. Read more
source§

impl TexCoords for Mesh

§

type TexCoord = Vec2

The point type used to represent texture coordinates.
§

type TexCoords = Vec<Vec2>

The channel type containing texture coordinates.
source§

fn tex_coords(&self) -> &Self::TexCoords

Borrow the texture coordinate channel from the mesh.

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
where T: Component + Float, Swp: WhitePoint, Dwp: WhitePoint, D: AdaptFrom<S, Swp, Dwp, T>,

source§

fn adapt_into_using<M>(self, method: M) -> D
where M: TransformMatrix<Swp, Dwp, T>,

Convert the source color to the destination color using the specified method
source§

fn adapt_into(self) -> D

Convert the source color to the destination color using the bradford method by default
source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> Clear for T

source§

fn clear(&mut self)

source§

impl<T, U> ConvertInto<U> for T
where U: ConvertFrom<T>,

source§

fn convert_into(self) -> U

Convert into T with values clamped to the color defined bounds Read more
source§

fn convert_unclamped_into(self) -> U

Convert into T. The resulting color might be invalid in its color space Read more
source§

fn try_convert_into(self) -> Result<U, OutOfBounds<U>>

Convert into T, returning ok if the color is inside of its defined range, otherwise an OutOfBounds error is returned which contains the unclamped color. Read more
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WasmNotSend for T
where T: Send,

§

impl<T> WasmNotSync for T
where T: Sync,