Skip to content

Commit

Permalink
Remove monkey.gltf (#9974)
Browse files Browse the repository at this point in the history
# 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)
  • Loading branch information
OneFourth authored Sep 30, 2023
1 parent 14db5b3 commit 857fb9c
Show file tree
Hide file tree
Showing 5 changed files with 117 additions and 129 deletions.
122 changes: 0 additions & 122 deletions assets/models/monkey/Monkey.gltf

This file was deleted.

110 changes: 110 additions & 0 deletions assets/models/torus/torus.gltf

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions examples/asset/asset_loading.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,23 +43,23 @@ 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 {
base_color: Color::rgb(0.8, 0.7, 0.6),
..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()
Expand Down
4 changes: 2 additions & 2 deletions examples/asset/hot_asset_reloading.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion examples/window/multiple_windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 857fb9c

Please sign in to comment.