summaryrefslogtreecommitdiff
path: root/servers/physics_3d
diff options
context:
space:
mode:
authorSilc Renew <tokage.it.lab@gmail.com>2022-08-10 10:14:36 +0900
committerSilc Renew <tokage.it.lab@gmail.com>2022-08-10 10:33:58 +0900
commit733129552384e3047e4e7703974ececa4cd57742 (patch)
treec431d08db72f7cc37ed9064e2851297b03e9eadd /servers/physics_3d
parent317ced8204d80367c445963fc989de320c6f9a68 (diff)
add get_depth() to KinematicCollision3D as same of 2D
Diffstat (limited to 'servers/physics_3d')
-rw-r--r--servers/physics_3d/godot_space_3d.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/servers/physics_3d/godot_space_3d.cpp b/servers/physics_3d/godot_space_3d.cpp
index 533d7605ce..13e9a89b2e 100644
--- a/servers/physics_3d/godot_space_3d.cpp
+++ b/servers/physics_3d/godot_space_3d.cpp
@@ -989,6 +989,7 @@ bool GodotSpace3D::test_body_motion(GodotBody3D *p_body, const PhysicsServer3D::
r_result->collision_unsafe_fraction = unsafe;
r_result->collision_count = rcd.result_count;
+ r_result->collision_depth = rcd.best_result.len;
}
collided = true;
@@ -1002,6 +1003,7 @@ bool GodotSpace3D::test_body_motion(GodotBody3D *p_body, const PhysicsServer3D::
r_result->collision_safe_fraction = 1.0;
r_result->collision_unsafe_fraction = 1.0;
+ r_result->collision_depth = 0.0;
}
return collided;