bevy/crates/bevy_transform
davier 0c374df712 Add insert_children and push_children to EntityMut (#1728)
The only API to add a parent/child relationship between existing entities is through commands, there is no easy way to do it from `World`. Manually inserting the components is not completely possible since `PreviousParent` has no public constructor.

This PR adds two methods to set entities as children of an `EntityMut`: `insert_children` and `push_children`. ~~The API is similar to the one on `Commands`, except that the parent is the `EntityMut`.~~ The API is the same as in #1703.
However, the `Parent` and `Children` components are defined in `bevy_transform` which depends on `bevy_ecs`, while `EntityMut` is defined in `bevy_ecs`, so the methods are added to the `BuildWorldChildren` trait instead.
If #1545 is merged this should be fixed too.

I'm aware cart was experimenting with entity hierarchies, but unless it's a coming soon this PR would be useful to have meanwhile.

Co-authored-by: Carter Anderson <mcanders1@gmail.com>
2021-03-26 20:03:12 +00:00
..
src Add insert_children and push_children to EntityMut (#1728) 2021-03-26 20:03:12 +00:00
.gitignore move bevy crates to their own folder 2020-04-24 17:57:20 -07:00
Cargo.toml release 0.4.0 (#1093) 2020-12-19 13:28:00 -06:00
LICENSE move bevy crates to their own folder 2020-04-24 17:57:20 -07:00
README.md transform: remove some dependencies and cleanup 2020-07-10 01:49:23 -07:00

Bevy Transform

This crate is largely a 1:1 port from legion_transform (ecs: legion, math: nalgebra) to bevy (ecs: bevy_ecs, math: glam)