mirror of
https://github.com/bevyengine/bevy
synced 2024-11-21 20:23:28 +00:00
Remove monkey.gltf (#9974)
# Objective - Fixes #9967 ## Solution - Remove `monkey.gltf` - Added `torus.gltf`, which is two torus meshes joined together, to replace `monkey.gltf` in the examples ## Examples I made `torus.gltf` mainly so that the multiple_windows example clearly shows the different camera angles ### asset_loading ![image](https://github.com/bevyengine/bevy/assets/425184/0ee51013-973d-4b23-9aa6-d254fecde7f1) ### hot_asset_reloading ![image](https://github.com/bevyengine/bevy/assets/425184/b2a2b1d8-167e-478b-b954-756ca0bbe469) ### multiple_windows: ![image](https://github.com/bevyengine/bevy/assets/425184/cb23de2c-9ff8-4843-a5c0-981e4d29ae49) ![image](https://github.com/bevyengine/bevy/assets/425184/b00bc2c7-66e8-4881-8fab-08269e223961)
This commit is contained in:
parent
14db5b38dc
commit
857fb9c724
5 changed files with 117 additions and 129 deletions
File diff suppressed because one or more lines are too long
110
assets/models/torus/torus.gltf
Normal file
110
assets/models/torus/torus.gltf
Normal file
File diff suppressed because one or more lines are too long
|
@ -43,13 +43,13 @@ fn setup(
|
|||
// to load.
|
||||
// If you want to keep the assets in the folder alive, make sure you store the returned handle
|
||||
// somewhere.
|
||||
let _loaded_folder: Handle<LoadedFolder> = asset_server.load_folder("models/monkey");
|
||||
let _loaded_folder: Handle<LoadedFolder> = asset_server.load_folder("models/torus");
|
||||
|
||||
// If you want a handle to a specific asset in a loaded folder, the easiest way to get one is to call load.
|
||||
// It will _not_ be loaded a second time.
|
||||
// The LoadedFolder asset will ultimately also hold handles to the assets, but waiting for it to load
|
||||
// and finding the right handle is more work!
|
||||
let monkey_handle = asset_server.load("models/monkey/Monkey.gltf#Mesh0/Primitive0");
|
||||
let torus_handle = asset_server.load("models/torus/torus.gltf#Mesh0/Primitive0");
|
||||
|
||||
// You can also add assets directly to their Assets<T> storage:
|
||||
let material_handle = materials.add(StandardMaterial {
|
||||
|
@ -57,9 +57,9 @@ fn setup(
|
|||
..default()
|
||||
});
|
||||
|
||||
// monkey
|
||||
// torus
|
||||
commands.spawn(PbrBundle {
|
||||
mesh: monkey_handle,
|
||||
mesh: torus_handle,
|
||||
material: material_handle.clone(),
|
||||
transform: Transform::from_xyz(-3.0, 0.0, 0.0),
|
||||
..default()
|
||||
|
|
|
@ -13,9 +13,9 @@ fn main() {
|
|||
|
||||
fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
|
||||
// Load our mesh:
|
||||
let scene_handle = asset_server.load("models/monkey/Monkey.gltf#Scene0");
|
||||
let scene_handle = asset_server.load("models/torus/torus.gltf#Scene0");
|
||||
|
||||
// Any changes to the mesh will be reloaded automatically! Try making a change to Monkey.gltf.
|
||||
// Any changes to the mesh will be reloaded automatically! Try making a change to torus.gltf.
|
||||
// You should see the changes immediately show up in your app.
|
||||
|
||||
// mesh
|
||||
|
|
|
@ -14,7 +14,7 @@ fn main() {
|
|||
fn setup_scene(mut commands: Commands, asset_server: Res<AssetServer>) {
|
||||
// add entities to the world
|
||||
commands.spawn(SceneBundle {
|
||||
scene: asset_server.load("models/monkey/Monkey.gltf#Scene0"),
|
||||
scene: asset_server.load("models/torus/torus.gltf#Scene0"),
|
||||
..default()
|
||||
});
|
||||
// light
|
||||
|
|
Loading…
Reference in a new issue