diff options
Diffstat (limited to 'modules/bullet')
-rw-r--r-- | modules/bullet/SCsub | 2 | ||||
-rw-r--r-- | modules/bullet/rigid_body_bullet.cpp | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/modules/bullet/SCsub b/modules/bullet/SCsub index 11ce18449b..7e714ba43f 100644 --- a/modules/bullet/SCsub +++ b/modules/bullet/SCsub @@ -187,6 +187,8 @@ if env['builtin_bullet']: thirdparty_sources = [thirdparty_dir + file for file in bullet2_src] env_bullet.Append(CPPPATH=[thirdparty_dir]) + # if env['target'] == "debug" or env['target'] == "release_debug": + # env_bullet.Append(CCFLAGS=['-DBT_DEBUG']) env_thirdparty = env_bullet.Clone() env_thirdparty.disable_warnings() diff --git a/modules/bullet/rigid_body_bullet.cpp b/modules/bullet/rigid_body_bullet.cpp index 09177205b4..22f2214898 100644 --- a/modules/bullet/rigid_body_bullet.cpp +++ b/modules/bullet/rigid_body_bullet.cpp @@ -797,6 +797,9 @@ void RigidBodyBullet::set_transform__bullet(const btTransform &p_global_transfor btBody->setLinearVelocity((p_global_transform.getOrigin() - btBody->getWorldTransform().getOrigin()) / space->get_delta_time()); // The kinematic use MotionState class godotMotionState->moveBody(p_global_transform); + } else { + // Is necesasry to avoid wrong location on the rendering side on the next frame + godotMotionState->setWorldTransform(p_global_transform); } CollisionObjectBullet::set_transform__bullet(p_global_transform); } @@ -822,7 +825,8 @@ void RigidBodyBullet::reload_shapes() { // shapes incorrectly do not set the vector in calculateLocalIntertia. // Arbitrary zero is preferable to undefined behaviour. btVector3 inertia(0, 0, 0); - mainShape->calculateLocalInertia(mass, inertia); + if (EMPTY_SHAPE_PROXYTYPE != mainShape->getShapeType()) // Necessary to avoid assertion of the empty shape + mainShape->calculateLocalInertia(mass, inertia); btBody->setMassProps(mass, inertia); } btBody->updateInertiaTensor(); |