diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-01-28 09:11:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-28 09:11:12 +0100 |
commit | cee84d1ed867c7667dbc0f6e47c31fbd48f0892f (patch) | |
tree | 3bf20f3724a271d829d03617dbf046f7f156e356 /modules | |
parent | bd55ac89646060359760c0fdcf39fef14d1a7fea (diff) | |
parent | 8d4617439c210fc4820fbe5cedca43ce32276e2a (diff) |
Merge pull request #25402 from AndreaCatania/sp_ce
Fixed Rigidbody first frame center spawn
Diffstat (limited to 'modules')
-rw-r--r-- | modules/bullet/rigid_body_bullet.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/bullet/rigid_body_bullet.cpp b/modules/bullet/rigid_body_bullet.cpp index 09177205b4..460ef043da 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); } |