bevyengine / bevyengine/bevy

Allow transformation trees to be subtrees of non-transformation trees

Open
#2,402 1 comment 0 reactions 0 assignees View on GitHub
C-Feature C-Usability S-Needs-Design-Doc
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

## 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 a `GlobalTransform` and a `Transform` 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 if `E` 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` or `Child` 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` and `GlobalTransform`. 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:
* LevelRoot
* EventTriggers
* SoundTriggers
* WorldSprites (with `Transform` and `GlobalTransform`)
* PlayerSprites (with `Transform` and `GlobalTransform`)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.