bevy/examples/3d
Carter Anderson cd15f0f5be Accept Bundles for insert and remove. Deprecate insert/remove_bundle (#6039)
# Objective

Take advantage of the "impl Bundle for Component" changes in #2975 / add the follow up changes discussed there.

## Solution

- Change `insert` and `remove` to accept a Bundle instead of a Component (for both Commands and World)
- Deprecate `insert_bundle`, `remove_bundle`, and `remove_bundle_intersection`
- Add `remove_intersection`

---

## Changelog

- Change `insert` and `remove` now accept a Bundle instead of a Component (for both Commands and World)
- `insert_bundle` and `remove_bundle` are deprecated
 

## Migration Guide

Replace `insert_bundle` with `insert`:
```rust
// Old (0.8)
commands.spawn().insert_bundle(SomeBundle::default());
// New (0.9)
commands.spawn().insert(SomeBundle::default());
```

Replace `remove_bundle` with `remove`:
```rust
// Old (0.8)
commands.entity(some_entity).remove_bundle::<SomeBundle>();
// New (0.9)
commands.entity(some_entity).remove::<SomeBundle>();
```

Replace `remove_bundle_intersection` with `remove_intersection`:
```rust
// Old (0.8)
world.entity_mut(some_entity).remove_bundle_intersection::<SomeBundle>();
// New (0.9)
world.entity_mut(some_entity).remove_intersection::<SomeBundle>();
```

Consider consolidating as many operations as possible to improve ergonomics and cut down on archetype moves:
```rust
// Old (0.8)
commands.spawn()
  .insert_bundle(SomeBundle::default())
  .insert(SomeComponent);

// New (0.9) - Option 1
commands.spawn().insert((
  SomeBundle::default(),
  SomeComponent,
))

// New (0.9) - Option 2
commands.spawn_bundle((
  SomeBundle::default(),
  SomeComponent,
))
```

## Next Steps

Consider changing `spawn` to accept a bundle and deprecate `spawn_bundle`.
2022-09-21 21:47:53 +00:00
..
3d_scene.rs Camera Driven Rendering (#4745) 2022-06-02 00:12:17 +00:00
lighting.rs Consistently use PI to specify angles in examples. (#5825) 2022-08-30 19:52:11 +00:00
lines.rs Accept Bundles for insert and remove. Deprecate insert/remove_bundle (#6039) 2022-09-21 21:47:53 +00:00
load_gltf.rs Consistently use PI to specify angles in examples. (#5825) 2022-08-30 19:52:11 +00:00
msaa.rs Camera Driven Rendering (#4745) 2022-06-02 00:12:17 +00:00
orthographic.rs Camera Driven Rendering (#4745) 2022-06-02 00:12:17 +00:00
parenting.rs Update codebase to use IntoIterator where possible. (#5269) 2022-07-11 15:28:50 +00:00
pbr.rs Camera Driven Rendering (#4745) 2022-06-02 00:12:17 +00:00
render_to_texture.rs Consistently use PI to specify angles in examples. (#5825) 2022-08-30 19:52:11 +00:00
shadow_biases.rs Consistently use PI to specify angles in examples. (#5825) 2022-08-30 19:52:11 +00:00
shadow_caster_receiver.rs Accept Bundles for insert and remove. Deprecate insert/remove_bundle (#6039) 2022-09-21 21:47:53 +00:00
shapes.rs Consistently use PI to specify angles in examples. (#5825) 2022-08-30 19:52:11 +00:00
skybox.rs Consistently use PI to specify angles in examples. (#5825) 2022-08-30 19:52:11 +00:00
spherical_area_lights.rs Camera Driven Rendering (#4745) 2022-06-02 00:12:17 +00:00
split_screen.rs Consistently use PI to specify angles in examples. (#5825) 2022-08-30 19:52:11 +00:00
spotlight.rs Consistently use PI to specify angles in examples. (#5825) 2022-08-30 19:52:11 +00:00
texture.rs Consistently use PI to specify angles in examples. (#5825) 2022-08-30 19:52:11 +00:00
transparency_3d.rs transparency_3d example tweaks (#4968) 2022-06-23 18:36:07 +00:00
two_passes.rs Add "depth_load_op" configuration to 3d Cameras (#4904) 2022-06-07 22:22:10 +00:00
update_gltf_scene.rs Update codebase to use IntoIterator where possible. (#5269) 2022-07-11 15:28:50 +00:00
vertex_colors.rs Camera Driven Rendering (#4745) 2022-06-02 00:12:17 +00:00
wireframe.rs Camera Driven Rendering (#4745) 2022-06-02 00:12:17 +00:00