forked from bevyengine/bevy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
86 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
2 changes: 0 additions & 2 deletions
2
crates/bevy_core/src/transform/mod.rs → crates/bevy_core/src/math/mod.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
mod face_toward; | ||
mod hierarchy; | ||
|
||
pub use face_toward::*; | ||
pub use hierarchy::*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
crates/bevy_core/src/transform/hierarchy.rs → ...bevy_transform/src/hierarchy/hierarchy.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
mod child_builder; | ||
mod hierarchy; | ||
mod hierarchy_maintenance_system; | ||
mod world_child_builder; | ||
|
||
pub use child_builder::*; | ||
pub use hierarchy::*; | ||
pub use hierarchy_maintenance_system::*; | ||
pub use world_child_builder::*; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,45 @@ | ||
pub use glam as math; | ||
|
||
pub mod child_builder; | ||
pub mod hierarchy; | ||
pub mod components; | ||
pub mod hierarchy_maintenance_system; | ||
pub mod local_transform_systems; | ||
pub mod transform_propagate_system; | ||
pub mod transform_systems; | ||
pub mod world_child_builder; | ||
|
||
pub mod prelude { | ||
pub use crate::{build_systems, child_builder::*, components::*, world_child_builder::*}; | ||
pub use crate::{components::*, hierarchy::*, TransformPlugin}; | ||
} | ||
|
||
use bevy_app::{AppBuilder, AppPlugin}; | ||
use bevy_ecs::{IntoQuerySystem, System}; | ||
use bevy_type_registry::RegisterType; | ||
use prelude::{Children, LocalTransform, NonUniformScale, Rotation, Scale, Transform, Translation}; | ||
|
||
// TODO: make this a plugin | ||
pub fn build_systems() -> Vec<Box<dyn System>> { | ||
let mut all_systems = Vec::with_capacity(5); | ||
pub(crate) fn transform_systems() -> Vec<Box<dyn System>> { | ||
let mut systems = Vec::with_capacity(5); | ||
|
||
all_systems.append(&mut hierarchy_maintenance_system::hierarchy_maintenance_systems()); | ||
all_systems.append(&mut local_transform_systems::local_transform_systems()); | ||
all_systems.append(&mut transform_systems::transform_systems()); | ||
all_systems.push(transform_propagate_system::transform_propagate_system.system()); | ||
systems.append(&mut hierarchy::hierarchy_maintenance_systems()); | ||
systems.append(&mut local_transform_systems::local_transform_systems()); | ||
systems.append(&mut transform_systems::transform_systems()); | ||
systems.push(transform_propagate_system::transform_propagate_system.system()); | ||
|
||
all_systems | ||
systems | ||
} | ||
|
||
#[derive(Default)] | ||
pub struct TransformPlugin; | ||
|
||
impl AppPlugin for TransformPlugin { | ||
fn build(&self, app: &mut AppBuilder) { | ||
app.register_component::<Children>() | ||
.register_component::<LocalTransform>() | ||
.register_component::<Transform>() | ||
.register_component::<Translation>() | ||
.register_component::<Rotation>() | ||
.register_component::<Scale>() | ||
.register_component::<NonUniformScale>() | ||
// add transform systems to startup so the first update is "correct" | ||
.add_startup_systems(transform_systems()) | ||
.add_systems(transform_systems()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters