mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 04:33:37 +00:00
eb51b4c28e
# Objective A step in the migration to required components: scenes! ## Solution As per the [selected proposal](https://hackmd.io/@bevy/required_components/%2FPJtNGVMMQhyM0zIvCJSkbA): - Deprecate `SceneBundle` and `DynamicSceneBundle`. - Add `SceneRoot` and `DynamicSceneRoot` components, which wrap a `Handle<Scene>` and `Handle<DynamicScene>` respectively. ## Migration Guide Asset handles for scenes and dynamic scenes must now be wrapped in the `SceneRoot` and `DynamicSceneRoot` components. Raw handles as components no longer spawn scenes. Additionally, `SceneBundle` and `DynamicSceneBundle` have been deprecated. Instead, use the scene components directly. Previously: ```rust let model_scene = asset_server.load(GltfAssetLabel::Scene(0).from_asset("model.gltf")); commands.spawn(SceneBundle { scene: model_scene, transform: Transform::from_xyz(-4.0, 0.0, -3.0), ..default() }); ``` Now: ```rust let model_scene = asset_server.load(GltfAssetLabel::Scene(0).from_asset("model.gltf")); commands.spawn(( SceneRoot(model_scene), Transform::from_xyz(-4.0, 0.0, -3.0), )); ``` |
||
---|---|---|
.. | ||
bevymark.rs | ||
many_animated_sprites.rs | ||
many_buttons.rs | ||
many_cubes.rs | ||
many_foxes.rs | ||
many_gizmos.rs | ||
many_glyphs.rs | ||
many_lights.rs | ||
many_sprites.rs | ||
README.md | ||
text_pipeline.rs | ||
transform_hierarchy.rs | ||
warning_string.txt |
Stress tests
These examples are used to stress test Bevy's performance in various ways. These should be run with the "stress-test" profile to accurately represent performance in production, otherwise they will run in cargo's default "dev" profile which is very slow.
Example Command
cargo run --profile stress-test --example <EXAMPLE>