clone_without_buffers
This commit is contained in:
@@ -82,6 +82,16 @@ impl Part {
|
||||
&self.faces
|
||||
}
|
||||
|
||||
/// Clones a part but without the vertex buffers.
|
||||
pub fn clone_without_buffer(&self) -> Part {
|
||||
Part {
|
||||
material_name: self.material_name.clone(),
|
||||
faces: self.faces.clone(),
|
||||
vertex_buffer: None,
|
||||
needs_update: true,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -139,6 +149,20 @@ impl Model {
|
||||
}
|
||||
}
|
||||
|
||||
/// Clones the model but without the vertex buffers.
|
||||
pub fn clone_without_buffers(&self) -> Model {
|
||||
Model {
|
||||
vertices: self.vertices.clone(),
|
||||
texture_coordinates: self.texture_coordinates.clone(),
|
||||
normals: self.normals.clone(),
|
||||
faces: self.faces.clone(),
|
||||
materials: self.materials.clone(),
|
||||
textures: self.textures.clone(),
|
||||
parts: self.parts.iter().map(Part::clone_without_buffer).collect(),
|
||||
current_part_index: self.current_part_index.clone(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Copies the materials and textures from the other model into self.
|
||||
pub fn merge_material_and_textures(&mut self, other: &Model) {
|
||||
// Merge the materials
|
||||
|
||||
Reference in New Issue
Block a user