@@ -29,12 +29,12 @@ use bevy::image::TextureFormatPixelInfo;
2929use bevy:: prelude:: {
3030 App , AssetPlugin , AssetServer , Assets , ButtonInput , Camera , Camera3d , Color , Commands ,
3131 Component , ComputedNode , DefaultPlugins , Dir3 , DirectionalLight , Entity , EnvironmentMapLight ,
32- FixedUpdate , GlobalAmbientLight , GlobalTransform , GltfAssetLabel , Handle , Image , ImageNode ,
33- IsDefaultUiCamera , KeyCode , MessageReader , MessageWriter , MinimalPlugins , Name , Node ,
34- PerspectiveProjection , Pickable , PluginGroup , PositionType , PostUpdate , Projection , Quat ,
35- Query , Res , ResMut , Resource , Scene , SceneRoot , Startup , Text , TextColor , TextFont ,
36- TextureAtlasLayout , Time , Transform , UVec2 , UiRect , Update , Val , Vec2 , Vec3 , Visibility ,
37- Window , WindowPlugin , With , Without , default,
32+ FixedUpdate , FontSize , GlobalAmbientLight , GlobalTransform , GltfAssetLabel , Handle , Image ,
33+ ImageNode , IsDefaultUiCamera , KeyCode , MessageReader , MessageWriter , MinimalPlugins , Name ,
34+ Node , PerspectiveProjection , Pickable , PluginGroup , PositionType , PostUpdate , Projection , Quat ,
35+ Query , Res , ResMut , Resource , Startup , Text , TextColor , TextFont , TextureAtlasLayout , Time ,
36+ Transform , UVec2 , UiRect , Update , Val , Vec2 , Vec3 , Visibility , Window , WindowPlugin , With ,
37+ Without , WorldAsset , WorldAssetRoot , default,
3838} ;
3939use bevy:: render:: render_resource:: { TextureDimension , TextureFormat , TextureUsages } ;
4040#[ cfg( not( target_arch = "wasm32" ) ) ]
@@ -136,8 +136,8 @@ struct SimKinematics {
136136
137137#[ derive( Resource ) ]
138138struct PendingQuadcopterSpawn {
139- quadcopter_scene : Handle < Scene > ,
140- city_scene : Handle < Scene > ,
139+ quadcopter_scene : Handle < WorldAsset > ,
140+ city_scene : Handle < WorldAsset > ,
141141}
142142
143143#[ derive( Resource , Clone , Copy , Debug , Default , PartialEq , Eq ) ]
@@ -785,7 +785,7 @@ fn setup_world(
785785 ..default ( )
786786 } ) ,
787787 Skybox {
788- image : skybox_handle. clone ( ) ,
788+ image : Some ( skybox_handle. clone ( ) ) ,
789789 brightness : 1000.0 ,
790790 ..default ( )
791791 } ,
@@ -815,7 +815,7 @@ fn setup_world(
815815 Name :: new ( "sun" ) ,
816816 DirectionalLight {
817817 illuminance : 12_000.0 ,
818- shadows_enabled : true ,
818+ shadow_maps_enabled : true ,
819819 ..default ( )
820820 } ,
821821 Transform :: from_translation ( Vec3 :: new ( 3.0 , 10.0 , 1.0 ) ) . looking_at ( Vec3 :: ZERO , Vec3 :: Y ) ,
@@ -840,7 +840,7 @@ fn setup_world(
840840
841841 commands. spawn ( (
842842 Name :: new ( "city" ) ,
843- SceneRoot ( city_scene) ,
843+ WorldAssetRoot ( city_scene) ,
844844 Transform {
845845 translation : city_translation,
846846 scale : city_scale,
@@ -873,7 +873,7 @@ fn spawn_quadcopter_when_world_ready(
873873 commands
874874 . spawn ( (
875875 Name :: new ( "quadcopter" ) ,
876- SceneRoot ( pending_spawn. quadcopter_scene . clone ( ) ) ,
876+ WorldAssetRoot ( pending_spawn. quadcopter_scene . clone ( ) ) ,
877877 RigidBody :: Dynamic ,
878878 transform,
879879 position,
@@ -1054,7 +1054,7 @@ fn spawn_loading_overlay(
10541054 Pickable :: IGNORE ,
10551055 Text :: new ( "Assets loading..." ) ,
10561056 TextFont {
1057- font_size : 18.0 ,
1057+ font_size : FontSize :: Px ( 18.0 ) ,
10581058 ..default ( )
10591059 } ,
10601060 TextColor ( Color :: srgb ( 0.93 , 0.96 , 1.0 ) ) ,
@@ -1107,7 +1107,7 @@ fn spawn_help_overlay(
11071107 Pickable :: IGNORE ,
11081108 Text :: new ( "View\n RC Link\n Arm\n Mode\n Throttle\n Roll/Pitch\n Yaw\n Reset" ) ,
11091109 TextFont {
1110- font_size : 12.0 ,
1110+ font_size : FontSize :: Px ( 12.0 ) ,
11111111 ..default ( )
11121112 } ,
11131113 TextColor ( Color :: srgb ( 0.78 , 0.86 , 0.96 ) ) ,
@@ -1118,7 +1118,7 @@ fn spawn_help_overlay(
11181118 SimHelpValuesText ,
11191119 Text :: new ( "FPV (V)\n Checking RC link..." ) ,
11201120 TextFont {
1121- font_size : 12.0 ,
1121+ font_size : FontSize :: Px ( 12.0 ) ,
11221122 ..default ( )
11231123 } ,
11241124 TextColor ( Color :: WHITE ) ,
@@ -1929,11 +1929,11 @@ fn update_osd_overlay(
19291929 let Some ( osd_canvas_assets) = osd_canvas_assets else {
19301930 return ;
19311931 } ;
1932- let Some ( canvas_image) = images. get_mut ( & osd_canvas_assets. canvas ) else {
1932+ let Some ( mut canvas_image) = images. get_mut ( & osd_canvas_assets. canvas ) else {
19331933 return ;
19341934 } ;
19351935
1936- rasterize_osd_canvas ( & osd_overlay, & raster_source, canvas_image) ;
1936+ rasterize_osd_canvas ( & osd_overlay, & raster_source, & mut canvas_image) ;
19371937}
19381938
19391939fn stop_copper_on_exit ( mut exit_events : MessageReader < AppExit > , mut copper : ResMut < CopperState > ) {
@@ -1960,7 +1960,7 @@ fn register_scene_reflect_types(app: &mut App) {
19601960 app. register_type :: < bevy:: prelude:: Handle < bevy:: prelude:: StandardMaterial > > ( ) ;
19611961 app. register_type :: < bevy:: prelude:: Handle < bevy:: prelude:: Image > > ( ) ;
19621962 app. register_type :: < bevy:: prelude:: Handle < bevy:: prelude:: Gltf > > ( ) ;
1963- app. register_type :: < bevy:: prelude:: Handle < bevy:: prelude:: Scene > > ( ) ;
1963+ app. register_type :: < bevy:: prelude:: Handle < bevy:: prelude:: WorldAsset > > ( ) ;
19641964 app. register_type :: < bevy:: gltf:: GltfExtras > ( ) ;
19651965 app. register_type :: < bevy:: gltf:: GltfSceneExtras > ( ) ;
19661966 app. register_type :: < bevy:: gltf:: GltfMeshExtras > ( ) ;
0 commit comments