-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[Merged by Bors] - Split bevy_hierarchy out from bevy_transform #4168
Conversation
@cart as part of this PR's merge process, can we get a |
crates/bevy_hierarchy/src/hierarchy/hierarchy_maintenance_system.rs
Outdated
Show resolved
Hide resolved
bors try |
tryBuild failed: |
Cannot link fully because bevy_hierarchy is not a dependency :(
Reduces pointless importing boilerplate
This reverts commit 013836a.
cb027d7
to
0deeede
Compare
btw, bevy_hierarchy is not reserved on crates.io. Even if this PR doesn't get merged, we should probably reserve it. https://crates.io/crates/bevy_hierarchy I made a PR for that bevyengine/bevy-crate-reservations#15 |
I object to the framing that a fully separate GlobalTransform component is a "mess". I personally think a named (and fully separate) GlobalTransform type is preferable to a more abstracted "component inheritance system". GlobalTransform having a separate type (and name) makes the context and "space" (as in "world space") of the component clear. It also leaves the door open to things like "adding a On the other hand, |
(but I do agree that it would be nice to cut down on code duplication ... impl macros or Deref are also options) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Just one baby nit.
bors r+ |
# Objective - Hierarchy tools are not just used for `Transform`: they are also used for scenes. - In the future there's interest in using them for other features, such as visiibility inheritance. - The fact that these tools are found in `bevy_transform` causes a great deal of user and developer confusion - Fixes #2758. ## Solution - Split `bevy_transform` into two! - Make everything work again. Note that this is a very tightly scoped PR: I *know* there are code quality and docs issues that existed in bevy_transform that I've just moved around. We should fix those in a seperate PR and try to merge this ASAP to reduce the bitrot involved in splitting an entire crate. ## Frustrations The API around `GlobalTransform` is a mess: we have massive code and docs duplication, no link between the two types and no clear way to extend this to other forms of inheritance. In the medium-term, I feel pretty strongly that `GlobalTransform` should be replaced by something like `Inherited<Transform>`, which lives in `bevy_hierarchy`: - avoids code duplication - makes the inheritance pattern extensible - links the types at the type-level - allows us to remove all references to inheritance from `bevy_transform`, making it more useful as a standalone crate and cleaning up its docs ## Additional context - double-blessed by @cart in #4141 (comment) and #2758 (comment) - preparation for more advanced / cleaner hierarchy tools: go read bevyengine/rfcs#53 ! - originally attempted by @finegeometer in #2789. It was a great idea, just needed more discussion! Co-authored-by: Carter Anderson <[email protected]>
Fair; this wasn't really the place or tone for it. I'm sorry for that @cart. I was frustrated about the code duplication, but we can debate the relative merits of that design somewhere else. |
No worries. I almost didn't say anything because its definitely ok to think something is a mess (although I try to avoid using that language to avoid hurting peoples' feelings ... and to account for the fact that I might find out I'm wrong about that assessment. When trying to get that point across, I think its better to just outline the specific facts of the situation rather than ascribe generic negative labels to things). I mainly brought it up because I'd rather leave "opinionated discussions and pronouncements about the value of a thing" to issues scoped to that topic. I selfishly don't want to defend my design choices in 10 different places :) |
# Objective - Hierarchy tools are not just used for `Transform`: they are also used for scenes. - In the future there's interest in using them for other features, such as visiibility inheritance. - The fact that these tools are found in `bevy_transform` causes a great deal of user and developer confusion - Fixes bevyengine#2758. ## Solution - Split `bevy_transform` into two! - Make everything work again. Note that this is a very tightly scoped PR: I *know* there are code quality and docs issues that existed in bevy_transform that I've just moved around. We should fix those in a seperate PR and try to merge this ASAP to reduce the bitrot involved in splitting an entire crate. ## Frustrations The API around `GlobalTransform` is a mess: we have massive code and docs duplication, no link between the two types and no clear way to extend this to other forms of inheritance. In the medium-term, I feel pretty strongly that `GlobalTransform` should be replaced by something like `Inherited<Transform>`, which lives in `bevy_hierarchy`: - avoids code duplication - makes the inheritance pattern extensible - links the types at the type-level - allows us to remove all references to inheritance from `bevy_transform`, making it more useful as a standalone crate and cleaning up its docs ## Additional context - double-blessed by @cart in bevyengine#4141 (comment) and bevyengine#2758 (comment) - preparation for more advanced / cleaner hierarchy tools: go read bevyengine/rfcs#53 ! - originally attempted by @finegeometer in bevyengine#2789. It was a great idea, just needed more discussion! Co-authored-by: Carter Anderson <[email protected]>
…for hierarchies. Probably since bevyengine/bevy#4168
# Objective - Hierarchy tools are not just used for `Transform`: they are also used for scenes. - In the future there's interest in using them for other features, such as visiibility inheritance. - The fact that these tools are found in `bevy_transform` causes a great deal of user and developer confusion - Fixes bevyengine#2758. ## Solution - Split `bevy_transform` into two! - Make everything work again. Note that this is a very tightly scoped PR: I *know* there are code quality and docs issues that existed in bevy_transform that I've just moved around. We should fix those in a seperate PR and try to merge this ASAP to reduce the bitrot involved in splitting an entire crate. ## Frustrations The API around `GlobalTransform` is a mess: we have massive code and docs duplication, no link between the two types and no clear way to extend this to other forms of inheritance. In the medium-term, I feel pretty strongly that `GlobalTransform` should be replaced by something like `Inherited<Transform>`, which lives in `bevy_hierarchy`: - avoids code duplication - makes the inheritance pattern extensible - links the types at the type-level - allows us to remove all references to inheritance from `bevy_transform`, making it more useful as a standalone crate and cleaning up its docs ## Additional context - double-blessed by @cart in bevyengine#4141 (comment) and bevyengine#2758 (comment) - preparation for more advanced / cleaner hierarchy tools: go read bevyengine/rfcs#53 ! - originally attempted by @finegeometer in bevyengine#2789. It was a great idea, just needed more discussion! Co-authored-by: Carter Anderson <[email protected]>
Objective
Transform
: they are also used for scenes.bevy_transform
causes a great deal of user and developer confusionSolution
bevy_transform
into two!Note that this is a very tightly scoped PR: I know there are code quality and docs issues that existed in bevy_transform that I've just moved around. We should fix those in a seperate PR and try to merge this ASAP to reduce the bitrot involved in splitting an entire crate.
Frustrations
The API around
GlobalTransform
is a mess: we have massive code and docs duplication, no link between the two types and no clear way to extend this to other forms of inheritance.In the medium-term, I feel pretty strongly that
GlobalTransform
should be replaced by something likeInherited<Transform>
, which lives inbevy_hierarchy
:bevy_transform
, making it more useful as a standalone crate and cleaning up its docsAdditional context