Allow transformation trees to be subtrees of non-transformation trees #2402
Labels
A-Hierarchy
Parent-child entity hierarchies
C-Feature
A new feature, making something new possible
C-Usability
A targeted quality-of-life change that makes Bevy easier to use
S-Needs-Design-Doc
This issue or PR is particularly complex, and needs an approved design doc before it can be merged
What problem does this solve or what need does it fill?
I'd like to organise my game level as a tree, with both non-geometrical entities and geometrical entities. For keeping order and easy unloading, it would be nice to be able to root transformation trees within another tree.
What solution would you like?
If an entity
E
that has both aGlobalTransform
and aTransform
has a parent that is missing at least one of those, then the entity should still be a valid root of a transformation tree. That is, the transformation system should update its global transformation in the same way as ifE
would not have any parent.Currently, such an entity
E
is ignored by the transformation system, and is simply rendered at the coordinate root, independent of its transform.What alternative(s) have you considered?
Have two or more separate trees for each level that are not related in any way by
Parent
orChild
relationships. This is possible, but not very desirable as all the bookkeeping for these trees would need to be implemented by the game developer. Also, it prevents the game developer from representing the logical structure of their entities correctly.Alternatively, the root of a level could get a default
Transform
andGlobalTransform
. However this seems hacky, as the root is merely a logical dummy node and has no representation in the game world.Additional context
A game level could for example be structured like this:
Transform
andGlobalTransform
)Transform
andGlobalTransform
)The text was updated successfully, but these errors were encountered: