Skip to content

Commit

Permalink
Added torus model (Two torus meshes joined together)
Browse files Browse the repository at this point in the history
Updated examples to use torus instead of Monkey model
  • Loading branch information
OneFourth committed Sep 30, 2023
1 parent 0b80806 commit 5b344c7
Show file tree
Hide file tree
Showing 4 changed files with 117 additions and 7 deletions.
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 5b344c7

Please sign in to comment.