Skip to content

Commit

Permalink
Fix angular locked axes in gyroscopic torque computation (#485)
Browse files Browse the repository at this point in the history
# Objective

Fixes #474.

The angular locked axes are applied to the inertia instead of the inverse inertia in gyroscopic torque computations introduced in #420, causing incorrect behavior.

## Solution

Apply the locked axes correctly.
  • Loading branch information
Jondolf authored Aug 10, 2024
1 parent b620e2b commit 3dee0c0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/dynamics/integrator/semi_implicit_euler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ pub fn integrate_velocity(
// However, the basic semi-implicit approach can blow up, as semi-implicit Euler
// extrapolates velocity and the gyroscopic torque is quadratic in the angular velocity.
// Thus, we use implicit Euler, which is much more accurate and stable, although slightly more expensive.
let effective_inertia = locked_axes.apply_to_rotation(inv_inertia.inverse().0);
let effective_inertia = locked_axes.apply_to_rotation(inv_inertia.0).inverse();
delta_ang_vel += solve_gyroscopic_torque(
*ang_vel,
rotation.0,
Expand Down

0 comments on commit 3dee0c0

Please sign in to comment.