pub struct MeshBuilder<'a> { /* private fields */ }
Expand description
Generics-free mesh builder.
Implementations§
Source§impl<'a> MeshBuilder<'a>
impl<'a> MeshBuilder<'a>
Sourcepub fn into_owned(self) -> MeshBuilder<'static>
pub fn into_owned(self) -> MeshBuilder<'static>
Convert builder into fully owned type. This forces internal vertex and index buffers to be cloned, which allows borrowed source buffers to be released.
Sourcepub fn with_indices<I>(self, indices: I) -> Self
pub fn with_indices<I>(self, indices: I) -> Self
Set indices buffer to the MeshBuilder
Sourcepub fn set_indices<I>(&mut self, indices: I) -> &mut Self
pub fn set_indices<I>(&mut self, indices: I) -> &mut Self
Set indices buffer to the MeshBuilder
Sourcepub fn with_vertices<V, D>(self, vertices: D) -> Self
pub fn with_vertices<V, D>(self, vertices: D) -> Self
Add another vertices to the MeshBuilder
Sourcepub fn add_vertices<V, D>(&mut self, vertices: D) -> &mut Self
pub fn add_vertices<V, D>(&mut self, vertices: D) -> &mut Self
Add another vertices to the MeshBuilder
Sourcepub fn with_prim_type(self, prim: Primitive) -> Self
pub fn with_prim_type(self, prim: Primitive) -> Self
Sets the primitive type of the mesh.
By default, meshes are constructed as triangle lists.
Sourcepub fn set_prim_type(&mut self, prim: Primitive) -> &mut Self
pub fn set_prim_type(&mut self, prim: Primitive) -> &mut Self
Sets the primitive type of the mesh.
By default, meshes are constructed as triangle lists.
Sourcepub fn build<B>(
&self,
queue: QueueId,
factory: &Factory<B>,
) -> Result<Mesh<B>, UploadError>where
B: Backend,
pub fn build<B>(
&self,
queue: QueueId,
factory: &Factory<B>,
) -> Result<Mesh<B>, UploadError>where
B: Backend,
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§
Source§impl<'a> Clone for MeshBuilder<'a>
impl<'a> Clone for MeshBuilder<'a>
Source§fn clone(&self) -> MeshBuilder<'a>
fn clone(&self) -> MeshBuilder<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<'a> Debug for MeshBuilder<'a>
impl<'a> Debug for MeshBuilder<'a>
Source§impl<'a> From<()> for MeshBuilder<'a>
impl<'a> From<()> for MeshBuilder<'a>
Source§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>
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>
Source§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>
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>
Source§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>
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>
Source§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>
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>
Source§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>
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>
Source§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>
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>
Source§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>
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>
Source§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>
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>
Source§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>
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>
Source§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>
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>
Source§impl<'a, K, L, M, N, O, P> From<(Vec<K>, Vec<L>, Vec<M>, Vec<N>, Vec<O>, Vec<P>)> for MeshBuilder<'a>
impl<'a, K, L, M, N, O, P> From<(Vec<K>, Vec<L>, Vec<M>, Vec<N>, Vec<O>, Vec<P>)> for MeshBuilder<'a>
Auto Trait Implementations§
impl<'a> Freeze for MeshBuilder<'a>
impl<'a> RefUnwindSafe for MeshBuilder<'a>
impl<'a> Send for MeshBuilder<'a>
impl<'a> Sync for MeshBuilder<'a>
impl<'a> Unpin for MeshBuilder<'a>
impl<'a> UnwindSafe for MeshBuilder<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)