Struct lambda::render::mesh::MeshBuilder
source · 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 more