diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-09-28 23:52:28 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-09-28 23:52:28 +0200 |
commit | 6b5880b765dcb14f9b6ad76f47746b4b053abe49 (patch) | |
tree | 05bbb5ed3b2c35b11679205602e3b6b4463f55c7 /servers/physics_3d | |
parent | e3464c8fc86e346c5c3a9d7d554cc2c5866ccb48 (diff) | |
parent | 215c5458f580b836bc45f934cbc8ad53d801c641 (diff) |
Merge pull request #66568 from rburing/cylinder_support_is_dead
`GodotCylinderShape3D::get_supports`: delete dead code
Diffstat (limited to 'servers/physics_3d')
-rw-r--r-- | servers/physics_3d/godot_shape_3d.cpp | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/servers/physics_3d/godot_shape_3d.cpp b/servers/physics_3d/godot_shape_3d.cpp index 5e310670a5..5574be20b7 100644 --- a/servers/physics_3d/godot_shape_3d.cpp +++ b/servers/physics_3d/godot_shape_3d.cpp @@ -735,29 +735,6 @@ void GodotCylinderShape3D::get_supports(const Vector3 &p_normal, int p_max, Vect r_amount = 1; r_type = FEATURE_POINT; r_supports[0] = get_support(p_normal); - return; - - Vector3 n = p_normal; - real_t h = n.y * Math::sqrt(0.25 * height * height + radius * radius); - if (Math::abs(h) > 1.0) { - // Top or bottom surface. - n.y = (n.y > 0.0) ? height * 0.5 : -height * 0.5; - } else { - // Lateral surface. - n.y = height * 0.5 * h; - } - - real_t s = Math::sqrt(n.x * n.x + n.z * n.z); - if (Math::is_zero_approx(s)) { - n.x = 0.0; - n.z = 0.0; - } else { - real_t scaled_radius = radius / s; - n.x = n.x * scaled_radius; - n.z = n.z * scaled_radius; - } - - r_supports[0] = n; } } |