bevy/crates
François c6958b3056 add a SceneBundle to spawn a scene (#2424)
# Objective

- Spawning a scene is handled as a special case with a command `spawn_scene` that takes an handle but doesn't let you specify anything else. This is the only handle that works that way.
- Workaround for this have been to add the `spawn_scene` on `ChildBuilder` to be able to specify transform of parent, or to make the `SceneSpawner` available to be able to select entities from a scene by their instance id

## Solution

Add a bundle
```rust
pub struct SceneBundle {
    pub scene: Handle<Scene>,
    pub transform: Transform,
    pub global_transform: GlobalTransform,
    pub instance_id: Option<InstanceId>,
}
```

and instead of 
```rust
commands.spawn_scene(asset_server.load("models/FlightHelmet/FlightHelmet.gltf#Scene0"));
```
you can do
```rust
commands.spawn_bundle(SceneBundle {
    scene: asset_server.load("models/FlightHelmet/FlightHelmet.gltf#Scene0"),
    ..Default::default()
});
```

The scene will be spawned as a child of the entity with the `SceneBundle`

~I would like to remove the command `spawn_scene` in favor of this bundle but didn't do it yet to get feedback first~

Co-authored-by: François <8672791+mockersf@users.noreply.github.com>
Co-authored-by: Carter Anderson <mcanders1@gmail.com>
2022-06-09 20:34:09 +00:00
..
bevy_animation Clippy improvements (#4665) 2022-05-31 01:38:07 +00:00
bevy_app Add global init and get accessors for all newtyped TaskPools (#2250) 2022-06-09 02:43:24 +00:00
bevy_asset Add global init and get accessors for all newtyped TaskPools (#2250) 2022-06-09 02:43:24 +00:00
bevy_audio Clippy improvements (#4665) 2022-05-31 01:38:07 +00:00
bevy_core Add global init and get accessors for all newtyped TaskPools (#2250) 2022-06-09 02:43:24 +00:00
bevy_core_pipeline Add "depth_load_op" configuration to 3d Cameras (#4904) 2022-06-07 22:22:10 +00:00
bevy_derive Decouple some dependencies (#3886) 2022-04-27 19:08:11 +00:00
bevy_diagnostic Split time functionality into bevy_time (#4187) 2022-05-26 00:27:18 +00:00
bevy_dylib Bump Bevy to 0.8.0-dev (#4505) 2022-04-17 23:04:52 +00:00
bevy_dynamic_plugin Bump Bevy to 0.8.0-dev (#4505) 2022-04-17 23:04:52 +00:00
bevy_ecs Replace ComponentSparseSet's internals with a Column (#4909) 2022-06-09 03:34:51 +00:00
bevy_ecs_compile_fail_tests Add methods for querying lists of entities. (#4879) 2022-06-06 16:09:16 +00:00
bevy_encase_derive Migrate to encase from crevice (#4339) 2022-05-18 21:09:21 +00:00
bevy_gilrs Update gilrs to v0.9 (#4848) 2022-05-30 17:26:23 +00:00
bevy_gltf Add global init and get accessors for all newtyped TaskPools (#2250) 2022-06-09 02:43:24 +00:00
bevy_hierarchy add a SceneBundle to spawn a scene (#2424) 2022-06-09 20:34:09 +00:00
bevy_input Update keyboard.rs docs in bevy_input (#4517) 2022-05-17 04:16:54 +00:00
bevy_internal Revert ndk-glue to 0.5 to synchronize with winit (#4916) 2022-06-04 14:30:44 +00:00
bevy_log Update tracing-tracy requirement from 0.8.0 to 0.9.0 (#4786) 2022-05-27 11:54:57 +00:00
bevy_macro_utils bevy_reflect_derive: Tidying up the code (#4712) 2022-05-12 19:43:23 +00:00
bevy_math Document bevy_math (#4591) 2022-04-26 18:23:29 +00:00
bevy_mikktspace Generate vertex tangents using mikktspace (#3872) 2022-05-31 22:53:54 +00:00
bevy_pbr add NO_STORAGE_BUFFERS_SUPPORT shaderdef when needed (#4949) 2022-06-06 20:00:30 +00:00
bevy_ptr Clippy improvements (#4665) 2022-05-31 01:38:07 +00:00
bevy_reflect Implement FusedIterator for eligible Iterator types (#4942) 2022-06-09 03:19:31 +00:00
bevy_render Implement FusedIterator for eligible Iterator types (#4942) 2022-06-09 03:19:31 +00:00
bevy_scene add a SceneBundle to spawn a scene (#2424) 2022-06-09 20:34:09 +00:00
bevy_sprite Camera Driven Rendering (#4745) 2022-06-02 00:12:17 +00:00
bevy_tasks Add global init and get accessors for all newtyped TaskPools (#2250) 2022-06-09 02:43:24 +00:00
bevy_text Camera Driven Rendering (#4745) 2022-06-02 00:12:17 +00:00
bevy_time Split time functionality into bevy_time (#4187) 2022-05-26 00:27:18 +00:00
bevy_transform Nightly clippy fixes (#3491) 2022-05-17 04:38:03 +00:00
bevy_ui Camera Driven Viewports (#4898) 2022-06-05 00:27:49 +00:00
bevy_utils Update gilrs to v0.9 (#4848) 2022-05-30 17:26:23 +00:00
bevy_window Camera Driven Rendering (#4745) 2022-06-02 00:12:17 +00:00
bevy_winit Fix crash when using Duration::MAX (#4900) 2022-06-02 19:42:20 +00:00