From 13e0385702c9b5d152f2781ff566e07db9aeddc3 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Tue, 14 Jul 2020 10:19:58 -0300 Subject: [PATCH] Properly pass safe margin on initialization. Fixes jitter. --- scene/3d/physics_body_3d.cpp | 2 +- servers/physics_3d/body_3d_sw.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scene/3d/physics_body_3d.cpp b/scene/3d/physics_body_3d.cpp index fda072e233c..72ae75b2365 100644 --- a/scene/3d/physics_body_3d.cpp +++ b/scene/3d/physics_body_3d.cpp @@ -1241,12 +1241,12 @@ void KinematicBody3D::_direct_state_changed(Object *p_state) { KinematicBody3D::KinematicBody3D() : PhysicsBody3D(PhysicsServer3D::BODY_MODE_KINEMATIC) { - margin = 0.001; locked_axis = 0; on_floor = false; on_ceiling = false; on_wall = false; + set_safe_margin(0.001); PhysicsServer3D::get_singleton()->body_set_force_integration_callback(get_rid(), this, "_direct_state_changed"); } diff --git a/servers/physics_3d/body_3d_sw.cpp b/servers/physics_3d/body_3d_sw.cpp index a3bdc96c9fe..d1f16cb4ae6 100644 --- a/servers/physics_3d/body_3d_sw.cpp +++ b/servers/physics_3d/body_3d_sw.cpp @@ -750,7 +750,7 @@ Body3DSW::Body3DSW() : active = true; mass = 1; - kinematic_safe_margin = 0.01; + kinematic_safe_margin = 0.001; //_inv_inertia=Transform(); _inv_mass = 1; bounce = 0;