2020-04-06 03:19:02 +00:00
|
|
|
pub mod bytes;
|
|
|
|
pub mod time;
|
2020-04-06 21:20:53 +00:00
|
|
|
pub mod transform;
|
2020-04-06 03:19:02 +00:00
|
|
|
|
2020-04-06 09:00:00 +00:00
|
|
|
use bevy_app::{stage, AppBuilder, AppPlugin};
|
2020-05-28 02:27:55 +00:00
|
|
|
use bevy_type_registry::RegisterType;
|
2020-05-27 02:47:33 +00:00
|
|
|
use bevy_transform::{
|
|
|
|
components::{
|
|
|
|
Children, LocalToParent, LocalToWorld, NonUniformScale, Rotation, Scale, Translation,
|
|
|
|
},
|
|
|
|
transform_system_bundle,
|
|
|
|
};
|
|
|
|
use glam::{Mat3, Mat4, Quat, Vec2, Vec3};
|
2020-04-30 23:13:21 +00:00
|
|
|
use legion::prelude::IntoSystem;
|
2020-05-13 23:35:38 +00:00
|
|
|
use time::{start_timer_system, stop_timer_system, Time};
|
2020-04-06 03:19:02 +00:00
|
|
|
|
|
|
|
#[derive(Default)]
|
|
|
|
pub struct CorePlugin;
|
|
|
|
|
|
|
|
impl AppPlugin for CorePlugin {
|
|
|
|
fn build(&self, app: &mut AppBuilder) {
|
|
|
|
for transform_system in transform_system_bundle::build(app.world_mut()).drain(..) {
|
|
|
|
app.add_system(transform_system);
|
|
|
|
}
|
|
|
|
|
2020-05-13 23:35:38 +00:00
|
|
|
app.init_resource::<Time>()
|
2020-05-26 01:49:29 +00:00
|
|
|
.register_component::<Children>()
|
|
|
|
.register_component::<LocalToParent>()
|
|
|
|
.register_component::<LocalToWorld>()
|
|
|
|
.register_component::<Translation>()
|
|
|
|
.register_component::<Rotation>()
|
|
|
|
.register_component::<Scale>()
|
|
|
|
.register_component::<NonUniformScale>()
|
2020-05-27 02:47:33 +00:00
|
|
|
.register_property_type::<Vec2>()
|
|
|
|
.register_property_type::<Vec3>()
|
|
|
|
.register_property_type::<Mat3>()
|
|
|
|
.register_property_type::<Mat4>()
|
|
|
|
.register_property_type::<Quat>()
|
2020-04-30 23:13:21 +00:00
|
|
|
.add_system_to_stage(stage::FIRST, start_timer_system.system())
|
|
|
|
.add_system_to_stage(stage::LAST, stop_timer_system.system());
|
2020-04-06 03:19:02 +00:00
|
|
|
}
|
|
|
|
}
|