pub struct MeshBuilder { /* private fields */ }
Expand description
Construction for a mesh.
Implementations§
Source§impl MeshBuilder
impl MeshBuilder
Sourcepub fn with_capacity(&mut self, size: usize) -> &mut Self
pub fn with_capacity(&mut self, size: usize) -> &mut Self
Allocates memory for the given number of vertices and fills the mesh with empty vertices.
Sourcepub fn with_vertex(&mut self, vertex: Vertex) -> &mut Self
pub fn with_vertex(&mut self, vertex: Vertex) -> &mut Self
Adds a vertex to the mesh.
Sourcepub fn with_attributes(&mut self, attributes: Vec<VertexAttribute>) -> &mut Self
pub fn with_attributes(&mut self, attributes: Vec<VertexAttribute>) -> &mut Self
Specify the attributes of the mesh. This is used to map the vertex data to the input of the vertex shader.
Sourcepub fn build(&self) -> Mesh
pub fn build(&self) -> Mesh
Builds a mesh from the vertices and indices that have been added to the builder and allocates the memory for the mesh on the GPU.
Sourcepub fn build_from_obj(&self, file_path: &str) -> Mesh
pub fn build_from_obj(&self, file_path: &str) -> Mesh
Builds a mesh from the vertices of an OBJ file. The mesh will have the same
attributes as the OBJ file and can be allocated on to the GPU with
BufferBuilder::build_from_mesh
.
Trait Implementations§
Source§impl Clone for MeshBuilder
impl Clone for MeshBuilder
Source§fn clone(&self) -> MeshBuilder
fn clone(&self) -> MeshBuilder
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for MeshBuilder
impl RefUnwindSafe for MeshBuilder
impl Send for MeshBuilder
impl Sync for MeshBuilder
impl Unpin for MeshBuilder
impl UnwindSafe for MeshBuilder
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
Mutably borrows from an owned value. Read more