Merge pull request #286 from funmaker/sleep_fix
Fix rigid bodies falling asleep when linear/angular threshold is negative
This commit is contained in:
@@ -352,8 +352,8 @@ impl IslandManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn update_energy(activation: &mut RigidBodyActivation, sq_linvel: Real, sq_angvel: Real, dt: Real) {
|
fn update_energy(activation: &mut RigidBodyActivation, sq_linvel: Real, sq_angvel: Real, dt: Real) {
|
||||||
if sq_linvel < activation.linear_threshold * activation.linear_threshold
|
if sq_linvel < activation.linear_threshold * activation.linear_threshold.abs()
|
||||||
&& sq_angvel < activation.angular_threshold * activation.angular_threshold
|
&& sq_angvel < activation.angular_threshold * activation.angular_threshold.abs()
|
||||||
{
|
{
|
||||||
activation.time_since_can_sleep += dt;
|
activation.time_since_can_sleep += dt;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user