Some commit
This commit is contained in:
@@ -374,6 +374,20 @@ impl Model {
|
||||
}
|
||||
}
|
||||
|
||||
/// Creates only non-existant vertex buffers, doesn't update the old ones.
|
||||
pub fn build_new_vertex_buffers(&mut self, renderer: &Renderer) {
|
||||
for part in &mut self.parts {
|
||||
if part.vertex_buffer.is_none() {
|
||||
Model::build_vertex_buffer_for_part(
|
||||
&self.vertices,
|
||||
&self.texture_coordinates,
|
||||
&self.normals,
|
||||
part,
|
||||
renderer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Creates a vertex buffer that can be rendered for a part of the model.
|
||||
pub fn build_vertex_buffer_for_part(
|
||||
vertices: &Vec<Vector3<f64>>,
|
||||
@@ -429,4 +443,9 @@ impl Model {
|
||||
pub fn get_texture_by_name(&self, name: &str) -> Option<&SrgbTexture2d> {
|
||||
self.textures[name].as_ref()
|
||||
}
|
||||
|
||||
/// Returns a ref mut to the table of textures.
|
||||
pub fn textures_mut(&mut self) -> &mut HashMap<String, Option<SrgbTexture2d>> {
|
||||
&mut self.textures
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user