[][src]Struct rendy_mesh::MeshBuilder

pub struct MeshBuilder<'a> { /* fields omitted */ }

Generics-free mesh builder.

Methods

impl<'a> MeshBuilder<'a>[src]

pub fn new() -> Self[src]

Create empty builder.

pub fn into_owned(self) -> MeshBuilder<'static>[src]

Convert builder into fully owned type. This forces internal vertex and index buffers to be cloned, which allows borrowed source buffers to be released.

pub fn with_indices<I>(self, indices: I) -> Self where
    I: Into<Indices<'a>>, 
[src]

Set indices buffer to the MeshBuilder

pub fn set_indices<I>(&mut self, indices: I) -> &mut Self where
    I: Into<Indices<'a>>, 
[src]

Set indices buffer to the MeshBuilder

pub fn with_vertices<V, D>(self, vertices: D) -> Self where
    V: AsVertex + 'a,
    D: Into<Cow<'a, [V]>>, 
[src]

Add another vertices to the MeshBuilder

pub fn add_vertices<V, D>(&mut self, vertices: D) -> &mut Self where
    V: AsVertex + 'a,
    D: Into<Cow<'a, [V]>>, 
[src]

Add another vertices to the MeshBuilder

pub fn with_prim_type(self, prim: Primitive) -> Self[src]

Sets the primitive type of the mesh.

By default, meshes are constructed as triangle lists.

pub fn set_prim_type(&mut self, prim: Primitive) -> &mut Self[src]

Sets the primitive type of the mesh.

By default, meshes are constructed as triangle lists.

pub fn build<B>(
    &self,
    queue: QueueId,
    factory: &Factory<B>
) -> Result<Mesh<B>, Error> where
    B: Backend
[src]

Builds and returns the new mesh.

A mesh expects all vertex buffers to have the same number of elements. If those are not equal, the length of smallest vertex buffer is selected, effectively discaring extra data from larger buffers.

Note that contents of index buffer is not validated.

Trait Implementations

impl<'a, A> From<Vec<A>> for MeshBuilder<'a> where
    A: AsVertex + 'a, 
[src]

impl<'a, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P> From<(Vec<A>, Vec<B>, Vec<C>, Vec<D>, Vec<E>, Vec<F>, Vec<G>, Vec<H>, Vec<I>, Vec<J>, Vec<K>, Vec<L>, Vec<M>, Vec<N>, Vec<O>, Vec<P>)> for MeshBuilder<'a> where
    A: AsVertex + 'a,
    B: AsVertex + 'a,
    C: AsVertex + 'a,
    D: AsVertex + 'a,
    E: AsVertex + 'a,
    F: AsVertex + 'a,
    G: AsVertex + 'a,
    H: AsVertex + 'a,
    I: AsVertex + 'a,
    J: AsVertex + 'a,
    K: AsVertex + 'a,
    L: AsVertex + 'a,
    M: AsVertex + 'a,
    N: AsVertex + 'a,
    O: AsVertex + 'a,
    P: AsVertex + 'a, 
[src]

impl<'a, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P> From<(Vec<B>, Vec<C>, Vec<D>, Vec<E>, Vec<F>, Vec<G>, Vec<H>, Vec<I>, Vec<J>, Vec<K>, Vec<L>, Vec<M>, Vec<N>, Vec<O>, Vec<P>)> for MeshBuilder<'a> where
    B: AsVertex + 'a,
    C: AsVertex + 'a,
    D: AsVertex + 'a,
    E: AsVertex + 'a,
    F: AsVertex + 'a,
    G: AsVertex + 'a,
    H: AsVertex + 'a,
    I: AsVertex + 'a,
    J: AsVertex + 'a,
    K: AsVertex + 'a,
    L: AsVertex + 'a,
    M: AsVertex + 'a,
    N: AsVertex + 'a,
    O: AsVertex + 'a,
    P: AsVertex + 'a, 
[src]

impl<'a, C, D, E, F, G, H, I, J, K, L, M, N, O, P> From<(Vec<C>, Vec<D>, Vec<E>, Vec<F>, Vec<G>, Vec<H>, Vec<I>, Vec<J>, Vec<K>, Vec<L>, Vec<M>, Vec<N>, Vec<O>, Vec<P>)> for MeshBuilder<'a> where
    C: AsVertex + 'a,
    D: AsVertex + 'a,
    E: AsVertex + 'a,
    F: AsVertex + 'a,
    G: AsVertex + 'a,
    H: AsVertex + 'a,
    I: AsVertex + 'a,
    J: AsVertex + 'a,
    K: AsVertex + 'a,
    L: AsVertex + 'a,
    M: AsVertex + 'a,
    N: AsVertex + 'a,
    O: AsVertex + 'a,
    P: AsVertex + 'a, 
[src]

impl<'a, D, E, F, G, H, I, J, K, L, M, N, O, P> From<(Vec<D>, Vec<E>, Vec<F>, Vec<G>, Vec<H>, Vec<I>, Vec<J>, Vec<K>, Vec<L>, Vec<M>, Vec<N>, Vec<O>, Vec<P>)> for MeshBuilder<'a> where
    D: AsVertex + 'a,
    E: AsVertex + 'a,
    F: AsVertex + 'a,
    G: AsVertex + 'a,
    H: AsVertex + 'a,
    I: AsVertex + 'a,
    J: AsVertex + 'a,
    K: AsVertex + 'a,
    L: AsVertex + 'a,
    M: AsVertex + 'a,
    N: AsVertex + 'a,
    O: AsVertex + 'a,
    P: AsVertex + 'a, 
[src]

impl<'a, E, F, G, H, I, J, K, L, M, N, O, P> From<(Vec<E>, Vec<F>, Vec<G>, Vec<H>, Vec<I>, Vec<J>, Vec<K>, Vec<L>, Vec<M>, Vec<N>, Vec<O>, Vec<P>)> for MeshBuilder<'a> where
    E: AsVertex + 'a,
    F: AsVertex + 'a,
    G: AsVertex + 'a,
    H: AsVertex + 'a,
    I: AsVertex + 'a,
    J: AsVertex + 'a,
    K: AsVertex + 'a,
    L: AsVertex + 'a,
    M: AsVertex + 'a,
    N: AsVertex + 'a,
    O: AsVertex + 'a,
    P: AsVertex + 'a, 
[src]

impl<'a, F, G, H, I, J, K, L, M, N, O, P> From<(Vec<F>, Vec<G>, Vec<H>, Vec<I>, Vec<J>, Vec<K>, Vec<L>, Vec<M>, Vec<N>, Vec<O>, Vec<P>)> for MeshBuilder<'a> where
    F: AsVertex + 'a,
    G: AsVertex + 'a,
    H: AsVertex + 'a,
    I: AsVertex + 'a,
    J: AsVertex + 'a,
    K: AsVertex + 'a,
    L: AsVertex + 'a,
    M: AsVertex + 'a,
    N: AsVertex + 'a,
    O: AsVertex + 'a,
    P: AsVertex + 'a, 
[src]

impl<'a, G, H, I, J, K, L, M, N, O, P> From<(Vec<G>, Vec<H>, Vec<I>, Vec<J>, Vec<K>, Vec<L>, Vec<M>, Vec<N>, Vec<O>, Vec<P>)> for MeshBuilder<'a> where
    G: AsVertex + 'a,
    H: AsVertex + 'a,
    I: AsVertex + 'a,
    J: AsVertex + 'a,
    K: AsVertex + 'a,
    L: AsVertex + 'a,
    M: AsVertex + 'a,
    N: AsVertex + 'a,
    O: AsVertex + 'a,
    P: AsVertex + 'a, 
[src]

impl<'a, H, I, J, K, L, M, N, O, P> From<(Vec<H>, Vec<I>, Vec<J>, Vec<K>, Vec<L>, Vec<M>, Vec<N>, Vec<O>, Vec<P>)> for MeshBuilder<'a> where
    H: AsVertex + 'a,
    I: AsVertex + 'a,
    J: AsVertex + 'a,
    K: AsVertex + 'a,
    L: AsVertex + 'a,
    M: AsVertex + 'a,
    N: AsVertex + 'a,
    O: AsVertex + 'a,
    P: AsVertex + 'a, 
[src]

impl<'a, I, J, K, L, M, N, O, P> From<(Vec<I>, Vec<J>, Vec<K>, Vec<L>, Vec<M>, Vec<N>, Vec<O>, Vec<P>)> for MeshBuilder<'a> where
    I: AsVertex + 'a,
    J: AsVertex + 'a,
    K: AsVertex + 'a,
    L: AsVertex + 'a,
    M: AsVertex + 'a,
    N: AsVertex + 'a,
    O: AsVertex + 'a,
    P: AsVertex + 'a, 
[src]

impl<'a, J, K, L, M, N, O, P> From<(Vec<J>, Vec<K>, Vec<L>, Vec<M>, Vec<N>, Vec<O>, Vec<P>)> for MeshBuilder<'a> where
    J: AsVertex + 'a,
    K: AsVertex + 'a,
    L: AsVertex + 'a,
    M: AsVertex + 'a,
    N: AsVertex + 'a,
    O: AsVertex + 'a,
    P: AsVertex + 'a, 
[src]

impl<'a, K, L, M, N, O, P> From<(Vec<K>, Vec<L>, Vec<M>, Vec<N>, Vec<O>, Vec<P>)> for MeshBuilder<'a> where
    K: AsVertex + 'a,
    L: AsVertex + 'a,
    M: AsVertex + 'a,
    N: AsVertex + 'a,
    O: AsVertex + 'a,
    P: AsVertex + 'a, 
[src]

impl<'a, L, M, N, O, P> From<(Vec<L>, Vec<M>, Vec<N>, Vec<O>, Vec<P>)> for MeshBuilder<'a> where
    L: AsVertex + 'a,
    M: AsVertex + 'a,
    N: AsVertex + 'a,
    O: AsVertex + 'a,
    P: AsVertex + 'a, 
[src]

impl<'a, M, N, O, P> From<(Vec<M>, Vec<N>, Vec<O>, Vec<P>)> for MeshBuilder<'a> where
    M: AsVertex + 'a,
    N: AsVertex + 'a,
    O: AsVertex + 'a,
    P: AsVertex + 'a, 
[src]

impl<'a, N, O, P> From<(Vec<N>, Vec<O>, Vec<P>)> for MeshBuilder<'a> where
    N: AsVertex + 'a,
    O: AsVertex + 'a,
    P: AsVertex + 'a, 
[src]

impl<'a, O, P> From<(Vec<O>, Vec<P>)> for MeshBuilder<'a> where
    O: AsVertex + 'a,
    P: AsVertex + 'a, 
[src]

impl<'a, P> From<(Vec<P>,)> for MeshBuilder<'a> where
    P: AsVertex + 'a, 
[src]

impl<'a> From<()> for MeshBuilder<'a>[src]

impl<'a> Clone for MeshBuilder<'a>[src]

impl<'a> Debug for MeshBuilder<'a>[src]

Auto Trait Implementations

impl<'a> Send for MeshBuilder<'a>

impl<'a> Sync for MeshBuilder<'a>

impl<'a> Unpin for MeshBuilder<'a>

impl<'a> UnwindSafe for MeshBuilder<'a>

impl<'a> RefUnwindSafe for MeshBuilder<'a>

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Supports<T> for T[src]