summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Catania <info@andreacatania.com>2019-01-28 08:30:26 +0100
committerAndrea Catania <info@andreacatania.com>2019-01-28 08:30:26 +0100
commit8d4617439c210fc4820fbe5cedca43ce32276e2a (patch)
tree3bf20f3724a271d829d03617dbf046f7f156e356
parentbd55ac89646060359760c0fdcf39fef14d1a7fea (diff)
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);
}