[Merged by Bors] - Split bevy_hierarchy out from bevy_transform#4168
[Merged by Bors] - Split bevy_hierarchy out from bevy_transform#4168alice-i-cecile wants to merge 22 commits intobevyengine:mainfrom
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) |
cart
left a comment
There was a problem hiding this comment.
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 <mcanders1@gmail.com>
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 <mcanders1@gmail.com>
…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 <mcanders1@gmail.com>
Objective
Transform: they are also used for scenes.bevy_transformcauses a great deal of user and developer confusionSolution
bevy_transforminto 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
GlobalTransformis 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
GlobalTransformshould 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