summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Moore <dar13.dev@gmail.com>2018-02-10 17:38:34 -0500
committerNeil Moore <dar13.dev@gmail.com>2018-02-13 19:14:10 -0500
commit5fb8a6a6c223561e1e7a11699eae8aca68f8abd6 (patch)
tree71353dcb852352ecee43b22362c0217d367d6894
parent31dd21a8d9c3d30d7347fc30f18cd17a41a9b4bc (diff)
Fixes gravity calculation for kinematic bodies in Bullet
-rw-r--r--modules/bullet/rigid_body_bullet.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/bullet/rigid_body_bullet.cpp b/modules/bullet/rigid_body_bullet.cpp
index 96a53f9f8b..f96218ef46 100644
--- a/modules/bullet/rigid_body_bullet.cpp
+++ b/modules/bullet/rigid_body_bullet.cpp
@@ -832,7 +832,8 @@ void RigidBodyBullet::on_exit_area(AreaBullet *p_area) {
void RigidBodyBullet::reload_space_override_modificator() {
- if (!is_active())
+ // Make sure that kinematic bodies have their total gravity calculated
+ if (!is_active() && PhysicsServer::BODY_MODE_KINEMATIC != mode)
return;
Vector3 newGravity(space->get_gravity_direction() * space->get_gravity_magnitude());