Skip to content

Commit

Permalink
Ensure Bullet gravity is not applied when Custom Integrator is on.
Browse files Browse the repository at this point in the history
  • Loading branch information
madmiraal committed Aug 2, 2020
1 parent 58712ba commit c31acd0
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions modules/bullet/rigid_body_bullet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1003,10 +1003,15 @@ void RigidBodyBullet::reload_space_override_modificator() {
newAngularDamp += space->get_angular_damp();
}

btVector3 newBtGravity;
G_TO_B(newGravity * gravity_scale, newBtGravity);
if (omit_forces_integration) {
// Custom behaviour.
btBody->setGravity(btVector3(0, 0, 0));
} else {
btVector3 newBtGravity;
G_TO_B(newGravity * gravity_scale, newBtGravity);
btBody->setGravity(newBtGravity);
}

btBody->setGravity(newBtGravity);
btBody->setDamping(newLinearDamp, newAngularDamp);
}

Expand Down

0 comments on commit c31acd0

Please sign in to comment.