diff --git a/assets/meshes/library/space2.glb b/assets/meshes/library/space2.glb index 0118e7c..80b162a 100644 Binary files a/assets/meshes/library/space2.glb and b/assets/meshes/library/space2.glb differ diff --git a/assets/meshes/library/space_corner_inside.glb b/assets/meshes/library/space_corner_inside.glb new file mode 100644 index 0000000..c7564f4 Binary files /dev/null and b/assets/meshes/library/space_corner_inside.glb differ diff --git a/assets/meshes/library/space_corner_outside.glb b/assets/meshes/library/space_corner_outside.glb new file mode 100644 index 0000000..46e443b Binary files /dev/null and b/assets/meshes/library/space_corner_outside.glb differ diff --git a/assets/meshes/library/space_door.glb b/assets/meshes/library/space_door.glb new file mode 100644 index 0000000..ea3f2e4 Binary files /dev/null and b/assets/meshes/library/space_door.glb differ diff --git a/assets/meshes/library/space_round_door.glb b/assets/meshes/library/space_round_door.glb new file mode 100644 index 0000000..0c2da67 Binary files /dev/null and b/assets/meshes/library/space_round_door.glb differ diff --git a/assets/meshes/library/space_round_hole.glb b/assets/meshes/library/space_round_hole.glb new file mode 100644 index 0000000..0f220bf Binary files /dev/null and b/assets/meshes/library/space_round_hole.glb differ diff --git a/assets/meshes/library/space_wall.glb b/assets/meshes/library/space_wall.glb new file mode 100644 index 0000000..33ecba6 Binary files /dev/null and b/assets/meshes/library/space_wall.glb differ diff --git a/assets/space2.blend b/assets/space2.blend index 4f4bdda..678d808 100644 Binary files a/assets/space2.blend and b/assets/space2.blend differ diff --git a/src/level_instantiation/mod.rs b/src/level_instantiation/mod.rs index 275a175..84dcecd 100644 --- a/src/level_instantiation/mod.rs +++ b/src/level_instantiation/mod.rs @@ -12,10 +12,14 @@ fn spawn_level( gltf_assets: Res ) { println!("LIBRARY: {:?}", gltf_assets.library); - let jumbo = gltf_assets.library.get("meshes/library/space2.glb").expect("Couldn't find object in library"); - let gltf = models.get(jumbo).expect("No model for space2"); + let mut x_offset = 0.0; + for mesh_name in ["corner_inside", "corner_outside", "wall", "door", "round_door", "round_hole"] { + let path = format!("meshes/library/space_{}.glb", mesh_name); + let handle = gltf_assets.library.get(&path).expect(&format!("Couldn't find {} in library", mesh_name)); + let gltf = models.get(handle).expect(&format!("No model for {}", mesh_name)); - // commands.spawn(SceneRoot(gltf.scenes[0].clone())); - let asset = gltf.default_scene.as_ref().expect("No scene in space2"); - commands.spawn(SceneRoot(asset.clone())); + let asset = gltf.default_scene.as_ref().expect(&format!("No scene in {}", mesh_name)); + commands.spawn((SceneRoot(asset.clone()), TransformBundle::from_transform(Transform::from_xyz(x_offset, 0.0, 0.0)))); + x_offset += 2.0; + } }