bevy/crates
Nicola Papale 689eab6fb7 Add an extension trait to EntityCommands to update hierarchy while preserving GlobalTransform (#7024)
# Objective

It is often necessary  to update an entity's parent
while keeping its GlobalTransform static. Currently
it is cumbersome and error-prone (two questions in
the discord `#help` channel in the past week)

- Part 2, resolves #5475
- Builds on: #7020.

## Solution

- Added the `BuildChildrenTransformExt` trait, it is part
  of `bevy::prelude` and adds the following methods to `EntityCommands`:
  - `set_parent_in_place`: Change the parent of an entity and
    update its `Transform` in order to preserve its `GlobalTransform` after the parent change
  - `remove_parent_in_place`: Remove an entity from a hierarchy,
    while preserving its `GlobalTransform`.

---

## Changelog


- Added the `BuildChildrenTransformExt` trait, it is part
  of `bevy::prelude` and adds the following methods to `EntityCommands`:
  - `set_parent_in_place`: Change the parent of an entity and
    update its `Transform` in order to preserve its `GlobalTransform` after the parent change
  - `remove_parent_in_place`: Remove an entity from a hierarchy,
    while preserving its `GlobalTransform`.

Co-authored-by: Nicola Papale <nicopap@users.noreply.github.com>
2023-01-12 18:46:11 +00:00
..
bevy_animation Smooth Transition between Animations (#6922) 2023-01-09 19:24:51 +00:00
bevy_app Fix beta clippy lints (#7154) 2023-01-11 09:51:22 +00:00
bevy_asset Fix beta clippy lints (#7154) 2023-01-11 09:51:22 +00:00
bevy_audio Expose symphonia features from rodio in bevy_audio and bevy (#6388) 2023-01-09 19:05:30 +00:00
bevy_core Break CorePlugin into TaskPoolPlugin, TypeRegistrationPlugin, FrameCountPlugin. (#7083) 2023-01-05 11:42:35 +00:00
bevy_core_pipeline Reduce branching in TrackedRenderPass (#7053) 2023-01-09 19:24:56 +00:00
bevy_derive Fix ndk-macro link (#7027) 2022-12-25 05:06:03 +00:00
bevy_diagnostic Fix various typos (#7096) 2023-01-06 00:43:30 +00:00
bevy_dylib Release 0.9.0 (#6568) 2022-11-12 20:01:29 +00:00
bevy_dynamic_plugin Adapt path type of dynamically_load_plugin (#6734) 2022-12-05 23:39:43 +00:00
bevy_ecs Mark TableRow and TableId as repr(transparent) (#7166) 2023-01-11 23:31:22 +00:00
bevy_ecs_compile_fail_tests Fix clippy lints and failed test with Rust 1.66 (#6945) 2022-12-15 18:05:15 +00:00
bevy_encase_derive add helper for macro to get either bevy::x or bevy_x depending on how it was imported (#7164) 2023-01-11 21:12:02 +00:00
bevy_gilrs Gamepad events refactor (#6965) 2023-01-09 19:24:52 +00:00
bevy_gltf enum Visibility component (#6320) 2022-12-25 00:39:29 +00:00
bevy_hierarchy Add an extension trait to EntityCommands to update hierarchy while preserving GlobalTransform (#7024) 2023-01-12 18:46:11 +00:00
bevy_input Added Ref to allow immutable access with change detection (#7097) 2023-01-11 15:41:54 +00:00
bevy_internal Expose symphonia features from rodio in bevy_audio and bevy (#6388) 2023-01-09 19:05:30 +00:00
bevy_log Fix suppression of all console logs when trace_tracy is enabled (#6955) 2022-12-20 23:45:43 +00:00
bevy_macro_utils add helper for macro to get either bevy::x or bevy_x depending on how it was imported (#7164) 2023-01-11 21:12:02 +00:00
bevy_math Improve code/comments for Ray::intersect_plane and its tests (#6823) 2022-12-05 22:49:06 +00:00
bevy_mikktspace Release 0.9.0 (#6568) 2022-11-12 20:01:29 +00:00
bevy_pbr Fix beta clippy lints (#7154) 2023-01-11 09:51:22 +00:00
bevy_ptr Ensure Ptr/PtrMut/OwningPtr are aligned when casting in debug builds (#7117) 2023-01-11 23:12:20 +00:00
bevy_reflect bevy_reflect: Add simple enum support to reflection paths (#6560) 2023-01-11 16:46:27 +00:00
bevy_reflect_compile_fail_tests bevy_reflect: Add compile fail tests for bevy_reflect (#7041) 2023-01-02 21:07:33 +00:00
bevy_render Improve render phase documentation (#7016) 2023-01-12 15:11:58 +00:00
bevy_scene Fix beta clippy lints (#7154) 2023-01-11 09:51:22 +00:00
bevy_sprite Fix various typos (#7096) 2023-01-06 00:43:30 +00:00
bevy_tasks Thread executor for running tasks on specific threads. (#7087) 2023-01-10 22:32:42 +00:00
bevy_text Remove TextError::ExceedMaxTextAtlases(usize) variant (#6796) 2022-12-05 23:23:16 +00:00
bevy_time Fix various typos (#7096) 2023-01-06 00:43:30 +00:00
bevy_transform Add an extension trait to EntityCommands to update hierarchy while preserving GlobalTransform (#7024) 2023-01-12 18:46:11 +00:00
bevy_ui Change default FocusPolicy to Pass (#7161) 2023-01-12 17:15:20 +00:00
bevy_utils Fix various typos (#7096) 2023-01-06 00:43:30 +00:00
bevy_window Fix various typos (#7096) 2023-01-06 00:43:30 +00:00
bevy_winit fix cursor grab issue (#7010) 2023-01-04 23:00:12 +00:00