Merge pull request #25402 from AndreaCatania/sp_ce

Fixed Rigidbody first frame center spawn
This commit is contained in:
Rémi Verschelde 2019-01-28 09:11:12 +01:00 committed by GitHub
commit cee84d1ed8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -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()); btBody->setLinearVelocity((p_global_transform.getOrigin() - btBody->getWorldTransform().getOrigin()) / space->get_delta_time());
// The kinematic use MotionState class // The kinematic use MotionState class
godotMotionState->moveBody(p_global_transform); 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); CollisionObjectBullet::set_transform__bullet(p_global_transform);
} }