summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-07-14 19:36:51 +0200
committerGitHub <noreply@github.com>2020-07-14 19:36:51 +0200
commit9d9716992892a2eb796bac856920d354e3243099 (patch)
tree5990a276f06b6a8026609dc2fa710c481dfa96e2
parent28d83ecf5ad000214a1875c5d30ff8da769db9e8 (diff)
parent13e0385702c9b5d152f2781ff566e07db9aeddc3 (diff)
Merge pull request #40377 from reduz/fix-default-kb3d-safe-margin
Properly pass safe margin on initialization.
-rw-r--r--scene/3d/physics_body_3d.cpp2
-rw-r--r--servers/physics_3d/body_3d_sw.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/scene/3d/physics_body_3d.cpp b/scene/3d/physics_body_3d.cpp
index fda072e233..72ae75b236 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 a3bdc96c9f..d1f16cb4ae 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;