-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Transform-preserving hierarchy update method #5475
Labels
A-Hierarchy
Parent-child entity hierarchies
A-Transform
Translations, rotations and scales
C-Usability
A targeted quality-of-life change that makes Bevy easier to use
Comments
nicopap
added
C-Feature
A new feature, making something new possible
D-Trivial
Nice and easy! A great choice to get started with Bevy
C-Usability
A targeted quality-of-life change that makes Bevy easier to use
A-Transform
Translations, rotations and scales
A-Hierarchy
Parent-child entity hierarchies
labels
Jul 28, 2022
alice-i-cecile
removed
the
C-Feature
A new feature, making something new possible
label
Jul 28, 2022
nicopap
removed
the
D-Trivial
Nice and easy! A great choice to get started with Bevy
label
Jul 28, 2022
nicopap
changed the title
Add more commands to deal with hierarchy
Add Transform-preserving hierarchy update method
Nov 4, 2022
This was referenced Dec 24, 2022
bors bot
pushed a commit
that referenced
this issue
Dec 25, 2022
# 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 1 of #5475 - Part 2: #7024. ## Solution - Add a `reparented_to` method to `GlobalTransform` --- ## Changelog - Add a `reparented_to` method to `GlobalTransform`
bors bot
pushed a commit
that referenced
this issue
Dec 25, 2022
# 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 1 of #5475 - Part 2: #7024. ## Solution - Add a `reparented_to` method to `GlobalTransform` --- ## Changelog - Add a `reparented_to` method to `GlobalTransform`
bors bot
pushed a commit
that referenced
this issue
Jan 12, 2023
…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>
alradish
pushed a commit
to alradish/bevy
that referenced
this issue
Jan 22, 2023
# 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 1 of bevyengine#5475 - Part 2: bevyengine#7024. ## Solution - Add a `reparented_to` method to `GlobalTransform` --- ## Changelog - Add a `reparented_to` method to `GlobalTransform`
alradish
pushed a commit
to alradish/bevy
that referenced
this issue
Jan 22, 2023
…preserving `GlobalTransform` (bevyengine#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 bevyengine#5475 - Builds on: bevyengine#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>
ItsDoot
pushed a commit
to ItsDoot/bevy
that referenced
this issue
Feb 1, 2023
# 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 1 of bevyengine#5475 - Part 2: bevyengine#7024. ## Solution - Add a `reparented_to` method to `GlobalTransform` --- ## Changelog - Add a `reparented_to` method to `GlobalTransform`
ItsDoot
pushed a commit
to ItsDoot/bevy
that referenced
this issue
Feb 1, 2023
…preserving `GlobalTransform` (bevyengine#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 bevyengine#5475 - Builds on: bevyengine#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>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-Hierarchy
Parent-child entity hierarchies
A-Transform
Translations, rotations and scales
C-Usability
A targeted quality-of-life change that makes Bevy easier to use
What problem does this solve or what need does it fill?
It is currently cumbersome and error-prone to update an entity's parent while keeping its
GlobalTransform
static.What solution would you like?
I'd like a method on
EntityCommands
that allows updating both the parent and the transform of an entity so that they keep theirGlobalTransform
.What alternative(s) have you considered?
It is possible to reparent keeping the same transform with the following code:
Then, the following to set both the parent and the transform in order to preserve the same
GlobalTransform
through the hierarchy change.The text was updated successfully, but these errors were encountered: