From 733129552384e3047e4e7703974ececa4cd57742 Mon Sep 17 00:00:00 2001 From: Silc Renew Date: Wed, 10 Aug 2022 10:14:36 +0900 Subject: add get_depth() to KinematicCollision3D as same of 2D --- servers/physics_3d/godot_space_3d.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'servers/physics_3d') 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; -- cgit v1.2.3