summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-01-28 09:11:12 +0100
committerGitHub <noreply@github.com>2019-01-28 09:11:12 +0100
commitcee84d1ed867c7667dbc0f6e47c31fbd48f0892f (patch)
tree3bf20f3724a271d829d03617dbf046f7f156e356
parentbd55ac89646060359760c0fdcf39fef14d1a7fea (diff)
parent8d4617439c210fc4820fbe5cedca43ce32276e2a (diff)
Merge pull request #25402 from AndreaCatania/sp_ce
Fixed Rigidbody first frame center spawn
-rw-r--r--modules/bullet/rigid_body_bullet.cpp3
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);
}