Merge pull request #13145 from AndreaCatania/grav

Set gravity on change body mode
This commit is contained in:
Rémi Verschelde 2017-11-21 19:24:52 +01:00 committed by GitHub
commit 9ebc6ab45a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -511,12 +511,14 @@ void RigidBodyBullet::set_mode(PhysicsServer::BodyMode p_mode) {
mode = PhysicsServer::BODY_MODE_RIGID; mode = PhysicsServer::BODY_MODE_RIGID;
set_axis_lock(axis_lock); // Reload axis lock set_axis_lock(axis_lock); // Reload axis lock
_internal_set_mass(0 == mass ? 1 : mass); _internal_set_mass(0 == mass ? 1 : mass);
scratch_space_override_modificator();
break; break;
} }
case PhysicsServer::BODY_MODE_CHARACTER: { case PhysicsServer::BODY_MODE_CHARACTER: {
mode = PhysicsServer::BODY_MODE_CHARACTER; mode = PhysicsServer::BODY_MODE_CHARACTER;
set_axis_lock(axis_lock); // Reload axis lock set_axis_lock(axis_lock); // Reload axis lock
_internal_set_mass(0 == mass ? 1 : mass); _internal_set_mass(0 == mass ? 1 : mass);
scratch_space_override_modificator();
break; break;
} }
} }