staggered updates

This commit is contained in:
yuni 2024-03-19 16:38:08 +01:00
parent 1c23861ec4
commit b0d6c600c6

View file

@ -126,9 +126,12 @@ pub fn update_physics_actors(
time: Res<Time>,
mut q_actors: Query<(&mut Actor, &mut Transform)>,
) {
let d = time.delta_seconds();
for (actor, mut transform) in q_actors.iter_mut() {
transform.rotate(actor.angular_momentum);
transform.translation += actor.v;
// TODO: animate only a step based on time between update:
//transform.rotate(actor.angular_momentum.slerp(Quat::IDENTITY, d)); // not working
transform.translation += d * actor.v;
}
}