From d4f11faf5a5198ea7165b9f3423693aa902c8c51 Mon Sep 17 00:00:00 2001 From: Robert Garrett Date: Sat, 9 Aug 2025 16:04:51 -0500 Subject: [PATCH] Fix: integrate rotation *correctly* Something something quaternions are hard. I thought I would take the two "things", add them together, and then put them back into the transform. That's clearly not how it works :v --- src/physics.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/physics.rs b/src/physics.rs index 761b827..6186a76 100644 --- a/src/physics.rs +++ b/src/physics.rs @@ -30,8 +30,7 @@ pub(crate) fn integrate_angular_velocity( ) { for (mut transform, ang_vel) in &mut objects { let delta = ang_vel.0 * time.delta_secs(); - let temp = transform.rotation + Quat::from_rotation_z(delta); - transform.rotation = temp; + transform.rotate_z(delta); } }