|
1 | 1 | use std::f32::consts::{PI, TAU}; |
2 | 2 |
|
3 | | -use bevy::{gltf::GltfPlugin, prelude::*, scene::SceneInstance}; |
| 3 | +use bevy::{gltf::GltfPlugin, prelude::*, world_serialization::WorldInstance}; |
4 | 4 | use bevy_mod_outline::{ |
5 | | - AsyncSceneInheritOutline, OutlinePlugin, OutlineVolume, ATTRIBUTE_OUTLINE_NORMAL, |
| 5 | + AsyncWorldInheritOutline, OutlinePlugin, OutlineVolume, ATTRIBUTE_OUTLINE_NORMAL, |
6 | 6 | }; |
7 | 7 |
|
8 | 8 | fn main() { |
@@ -41,29 +41,29 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) { |
41 | 41 | commands.spawn(( |
42 | 42 | Transform::from_rotation(Quat::from_euler(EulerRot::ZYX, 0.0, 1.0, -PI / 4.)), |
43 | 43 | DirectionalLight { |
44 | | - shadows_enabled: true, |
| 44 | + shadow_maps_enabled: true, |
45 | 45 | ..default() |
46 | 46 | }, |
47 | 47 | )); |
48 | 48 |
|
49 | 49 | // Hollow |
50 | 50 | commands.spawn(( |
51 | | - SceneRoot(asset_server.load("hollow.glb#Scene0")), |
| 51 | + WorldAssetRoot(asset_server.load("hollow.glb#Scene0")), |
52 | 52 | RotatesAndPulses, |
53 | 53 | OutlineVolume { |
54 | 54 | visible: true, |
55 | 55 | width: 0.0, |
56 | 56 | colour: Color::srgb(0.0, 0.0, 1.0), |
57 | 57 | }, |
58 | | - AsyncSceneInheritOutline::default(), |
| 58 | + AsyncWorldInheritOutline::default(), |
59 | 59 | )); |
60 | 60 | } |
61 | 61 |
|
62 | 62 | // Once the scene is loaded, start the animation and add an outline |
63 | 63 | fn setup_scene_once_loaded( |
64 | 64 | mut commands: Commands, |
65 | | - scene_query: Query<&SceneInstance>, |
66 | | - scene_manager: Res<SceneSpawner>, |
| 65 | + scene_query: Query<&WorldInstance>, |
| 66 | + scene_manager: Res<WorldInstanceSpawner>, |
67 | 67 | name_query: Query<&Name, With<Mesh3d>>, |
68 | 68 | mut done: Local<bool>, |
69 | 69 | ) { |
@@ -103,7 +103,7 @@ fn rotates_hue( |
103 | 103 | timer: Res<Time>, |
104 | 104 | ) { |
105 | 105 | for handle in query.iter() { |
106 | | - let material = materials.get_mut(handle.id()).unwrap(); |
| 106 | + let mut material = materials.get_mut(handle.id()).unwrap(); |
107 | 107 | if let Color::Hsla(hsla) = material.base_color { |
108 | 108 | material.base_color = Color::Hsla(Hsla { |
109 | 109 | hue: (hsla.hue + 15.0 * timer.delta_secs()) % 360.0, |
|
0 commit comments