diff --git a/assets/meshes/library/space_corner_inside.glb b/assets/meshes/library/space_corner_inside.glb index c7564f4..8102447 100644 Binary files a/assets/meshes/library/space_corner_inside.glb 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 index 46e443b..07cf38b 100644 Binary files a/assets/meshes/library/space_corner_outside.glb 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 index ea3f2e4..acabc1f 100644 Binary files a/assets/meshes/library/space_door.glb 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 index 0c2da67..c0c8256 100644 Binary files a/assets/meshes/library/space_round_door.glb 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 index 0f220bf..f309915 100644 Binary files a/assets/meshes/library/space_round_hole.glb 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 index 33ecba6..c955f08 100644 Binary files a/assets/meshes/library/space_wall.glb and b/assets/meshes/library/space_wall.glb differ diff --git a/assets/space2.blend b/assets/space2.blend index 678d808..67cd602 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 84dcecd..335a8a1 100644 --- a/src/level_instantiation/mod.rs +++ b/src/level_instantiation/mod.rs @@ -12,14 +12,34 @@ fn spawn_level( gltf_assets: Res ) { println!("LIBRARY: {:?}", gltf_assets.library); - let mut x_offset = 0.0; - for mesh_name in ["corner_inside", "corner_outside", "wall", "door", "round_door", "round_hole"] { + let shapes = ["corner_inside", "corner_outside", "wall", "door", "round_door", "round_hole"].map(|mesh_name| { 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)); 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)))); + SceneRoot(asset.clone()) + }); + let [ + corner_inside, + corner_outside, + wall, + door, + round_door, + round_hole + ] = shapes; + let mut x_offset = 0.0; + for i in 0..10 { + commands.spawn(( + wall.clone(), + Transform::from_xyz(i as f32 * 2.0, 0.0, 0.0), + )); + + commands.spawn(( + wall.clone(), + Transform::from_xyz(i as f32 * 2.0, 0.0, 0.0) + .with_rotation(Quat::from_rotation_y(std::f32::consts::PI)), + )); x_offset += 2.0; } }