diff --git a/src/actor.rs b/src/actor.rs index 6b292e4..9a1cc7b 100644 --- a/src/actor.rs +++ b/src/actor.rs @@ -10,7 +10,10 @@ impl Plugin for ActorPlugin { app.add_systems(Startup, setup); app.register_type::(); app.register_type::(); - app.add_systems(FixedUpdate, update); + app.add_systems(FixedUpdate, ( + update_physics_lifeforms, + update_physics_actors, + )); app.add_systems(Update, ( handle_new_conversations, handle_conversations, @@ -30,7 +33,7 @@ pub struct Actor { pub hp: f32, pub m: f32, // mass pub v: Vec3, // velocity - // TODO: rotation + pub angular_momentum: Quat, } impl Default for Actor { @@ -39,6 +42,7 @@ impl Default for Actor { hp: 100.0, m: 100.0, v: Vec3::ZERO, + angular_momentum: Quat::from_euler(EulerRot::XYZ, 0.001, 0.01, 0.003), } } } @@ -118,7 +122,16 @@ pub fn setup( }); } -pub fn update( +pub fn update_physics_actors( + time: Res