From 8d4617439c210fc4820fbe5cedca43ce32276e2a Mon Sep 17 00:00:00 2001 From: Andrea Catania Date: Mon, 28 Jan 2019 08:30:26 +0100 Subject: Fixed Rigidbody first frame center spawn --- modules/bullet/rigid_body_bullet.cpp | 3 +++ 1 file changed, 3 insertions(+) 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); } -- cgit v1.2.3