Merge pull request #16547 from Dar13/kinematic_gravity_fix

Fixes gravity calculation for kinematic bodies in Bullet
This commit is contained in:
Rémi Verschelde 2018-02-14 08:14:38 +01:00 committed by GitHub
commit 232e03e5e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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());