From 25bedade3bcf09173271a4285783b3b924b53a8a Mon Sep 17 00:00:00 2001 From: Marcel Admiraal Date: Thu, 6 Aug 2020 17:09:45 +0100 Subject: [PATCH] Do not set gravity and damping when Custom Integrator is enabled. --- modules/bullet/rigid_body_bullet.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/bullet/rigid_body_bullet.cpp b/modules/bullet/rigid_body_bullet.cpp index 170072814cb..87c15c32128 100644 --- a/modules/bullet/rigid_body_bullet.cpp +++ b/modules/bullet/rigid_body_bullet.cpp @@ -917,6 +917,13 @@ void RigidBodyBullet::reload_space_override_modificator() { return; } + if (omit_forces_integration) { + // Custom behaviour. + btBody->setGravity(btVector3(0, 0, 0)); + btBody->setDamping(0, 0); + return; + } + Vector3 newGravity(0.0, 0.0, 0.0); real_t newLinearDamp = MAX(0.0, linearDamp); real_t newAngularDamp = MAX(0.0, angularDamp);