This commit is contained in:
2021-08-15 22:34:29 +02:00
parent c619f945a3
commit 40aa7f635e
11 changed files with 273 additions and 56 deletions

View File

@@ -18,14 +18,15 @@ pub struct GameObject {
pub scale: Vector3<f32>,
pub children: Vec<GameObject>,
pub descriptor_sets: Vec<Arc<RendererDescriptorSets>>,
pub is_selected: bool
pub is_selected: bool,
pub pipeline_index: usize,
}
impl GameObject {
pub fn new(mesh: MeshHandle) -> GameObject {
GameObject { mesh_index: mesh.index, texture_index: mesh.diffuse_handle, normal_map_index: mesh.normal_handle.unwrap_or(0), 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 }
descriptor_sets: vec![], is_selected: false, pipeline_index: mesh.pipeline_index }
}
pub fn _set_position(&mut self, x: f32, y: f32, z: f32) {