cleanup
This commit is contained in:
@@ -20,6 +20,7 @@ pub struct GameObject {
|
||||
pub descriptor_sets: Vec<Arc<RendererDescriptorSets>>,
|
||||
pub is_selected: bool,
|
||||
pub pipeline_index: usize,
|
||||
pub visible: bool,
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
@@ -37,7 +38,7 @@ impl GameObject {
|
||||
|
||||
GameObject { mesh_index: mesh.index, textures, position: Vector3::new(0.0, 0.0, 0.0),
|
||||
rotation: Quaternion::new(1.0, 0.0, 0.0, 0.0), scale: Vector3::new(1.0, 1.0, 1.0), children: vec![],
|
||||
descriptor_sets: vec![], is_selected: false, pipeline_index: mesh.pipeline_index }
|
||||
descriptor_sets: vec![], is_selected: false, pipeline_index: mesh.pipeline_index, visible: true }
|
||||
}
|
||||
|
||||
pub fn init_descriptor_sets(&mut self, renderer: &mut VulkanRenderer) {
|
||||
|
||||
@@ -335,7 +335,8 @@ impl VulkanRenderer {
|
||||
// Draw meshes etc.
|
||||
let mut index = 0;
|
||||
for pipeline in &self.pipelines {
|
||||
pipeline.draw(&mut builder, fb_index, game_objects.iter().filter(|go| go.pipeline_index == index).collect(), &self.game_data, &self.dynamic_state);
|
||||
let objects = game_objects.iter().filter(|go| go.visible && go.pipeline_index == index).collect();
|
||||
pipeline.draw(&mut builder, fb_index, objects, &self.game_data, &self.dynamic_state);
|
||||
index += 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user