Skip to content

Commit

Permalink
Hierarchy commandization (bevyengine#4197)
Browse files Browse the repository at this point in the history
## Objective
Implement absolute minimum viable product for the changes proposed in bevyengine/rfcs#53.

## Solution

 - Remove public mutative access to `Parent` (Children is already publicly read-only). This includes public construction methods like `Copy`, `Clone`, and `Default`.
 - Remove `PreviousParent`
 - Remove `parent_update_system`
 - Update all hierarchy related commands to immediately update both `Parent` and `Children` references.

## Remaining TODOs

 - [ ] Update documentation for both `Parent` and `Children`. Discourage using `EntityCommands::remove`
 - [x] Add `HierarchyEvent` to notify listeners of hierarchy updates. This is meant to replace listening on `PreviousParent`

## Followup

 - These changes should be best moved to the hooks mentioned in bevyengine#3742.
 - Backing storage for both might be best moved to indexes mentioned in the same relations.
  • Loading branch information
james7132 authored and ItsDoot committed Feb 1, 2023
1 parent 788533f commit 2041768
Show file tree
Hide file tree
Showing 13 changed files with 315 additions and 441 deletions.
6 changes: 2 additions & 4 deletions crates/bevy_animation/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use bevy_ecs::{
schedule::ParallelSystemDescriptorCoercion,
system::{Query, Res},
};
use bevy_hierarchy::{Children, HierarchySystem};
use bevy_hierarchy::Children;
use bevy_math::{Quat, Vec3};
use bevy_reflect::{Reflect, TypeUuid};
use bevy_time::Time;
Expand Down Expand Up @@ -295,9 +295,7 @@ impl Plugin for AnimationPlugin {
.register_type::<AnimationPlayer>()
.add_system_to_stage(
CoreStage::PostUpdate,
animation_player
.before(TransformSystem::TransformPropagate)
.after(HierarchySystem::ParentUpdate),
animation_player.before(TransformSystem::TransformPropagate),
);
}
}
Loading

0 comments on commit 2041768

Please sign in to comment.