Fix rigid bodies falling asleep when linear/angular threshold is negative.

This commit is contained in:
Fun Maker
2022-01-31 20:23:42 +01:00
parent ce3cf553c2
commit 8c5f88738d

View File

@@ -352,8 +352,8 @@ impl IslandManager {
}
fn update_energy(activation: &mut RigidBodyActivation, sq_linvel: Real, sq_angvel: Real, dt: Real) {
if sq_linvel < activation.linear_threshold * activation.linear_threshold
&& sq_angvel < activation.angular_threshold * activation.angular_threshold
if sq_linvel < activation.linear_threshold * activation.linear_threshold.abs()
&& sq_angvel < activation.angular_threshold * activation.angular_threshold.abs()
{
activation.time_since_can_sleep += dt;
} else {