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  ### hot_asset_reloading  ### multiple_windows:  
This commit is contained in:
parent
14db5b38dc
commit
857fb9c724
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.
|
// to load.
|
||||||
// If you want to keep the assets in the folder alive, make sure you store the returned handle
|
// If you want to keep the assets in the folder alive, make sure you store the returned handle
|
||||||
// somewhere.
|
// 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.
|
// 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.
|
// 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
|
// 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!
|
// 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:
|
// You can also add assets directly to their Assets<T> storage:
|
||||||
let material_handle = materials.add(StandardMaterial {
|
let material_handle = materials.add(StandardMaterial {
|
||||||
@ -57,9 +57,9 @@ fn setup(
|
|||||||
..default()
|
..default()
|
||||||
});
|
});
|
||||||
|
|
||||||
// monkey
|
// torus
|
||||||
commands.spawn(PbrBundle {
|
commands.spawn(PbrBundle {
|
||||||
mesh: monkey_handle,
|
mesh: torus_handle,
|
||||||
material: material_handle.clone(),
|
material: material_handle.clone(),
|
||||||
transform: Transform::from_xyz(-3.0, 0.0, 0.0),
|
transform: Transform::from_xyz(-3.0, 0.0, 0.0),
|
||||||
..default()
|
..default()
|
||||||
|
@ -13,9 +13,9 @@ fn main() {
|
|||||||
|
|
||||||
fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
|
fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
|
||||||
// Load our mesh:
|
// 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.
|
// You should see the changes immediately show up in your app.
|
||||||
|
|
||||||
// mesh
|
// mesh
|
||||||
|
@ -14,7 +14,7 @@ fn main() {
|
|||||||
fn setup_scene(mut commands: Commands, asset_server: Res<AssetServer>) {
|
fn setup_scene(mut commands: Commands, asset_server: Res<AssetServer>) {
|
||||||
// add entities to the world
|
// add entities to the world
|
||||||
commands.spawn(SceneBundle {
|
commands.spawn(SceneBundle {
|
||||||
scene: asset_server.load("models/monkey/Monkey.gltf#Scene0"),
|
scene: asset_server.load("models/torus/torus.gltf#Scene0"),
|
||||||
..default()
|
..default()
|
||||||
});
|
});
|
||||||
// light
|
// light
|
||||||
|
Loading…
Reference in New Issue
Block a user