properly alligned and scaled space set
This commit is contained in:
Binary file not shown.
BIN
assets/meshes/library/space_corner_inside.glb
Normal file
BIN
assets/meshes/library/space_corner_inside.glb
Normal file
Binary file not shown.
BIN
assets/meshes/library/space_corner_outside.glb
Normal file
BIN
assets/meshes/library/space_corner_outside.glb
Normal file
Binary file not shown.
BIN
assets/meshes/library/space_door.glb
Normal file
BIN
assets/meshes/library/space_door.glb
Normal file
Binary file not shown.
BIN
assets/meshes/library/space_round_door.glb
Normal file
BIN
assets/meshes/library/space_round_door.glb
Normal file
Binary file not shown.
BIN
assets/meshes/library/space_round_hole.glb
Normal file
BIN
assets/meshes/library/space_round_hole.glb
Normal file
Binary file not shown.
BIN
assets/meshes/library/space_wall.glb
Normal file
BIN
assets/meshes/library/space_wall.glb
Normal file
Binary file not shown.
Binary file not shown.
@@ -12,10 +12,14 @@ fn spawn_level(
|
|||||||
gltf_assets: Res<GltfAssets>
|
gltf_assets: Res<GltfAssets>
|
||||||
) {
|
) {
|
||||||
println!("LIBRARY: {:?}", gltf_assets.library);
|
println!("LIBRARY: {:?}", gltf_assets.library);
|
||||||
let jumbo = gltf_assets.library.get("meshes/library/space2.glb").expect("Couldn't find object in library");
|
let mut x_offset = 0.0;
|
||||||
let gltf = models.get(jumbo).expect("No model for space2");
|
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(&format!("No scene in {}", mesh_name));
|
||||||
let asset = gltf.default_scene.as_ref().expect("No scene in space2");
|
commands.spawn((SceneRoot(asset.clone()), TransformBundle::from_transform(Transform::from_xyz(x_offset, 0.0, 0.0))));
|
||||||
commands.spawn(SceneRoot(asset.clone()));
|
x_offset += 2.0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user