GodotCylinderShape3D::get_supports
: delete dead code
#66568
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Delete dead code which was presumably left over from testing. I didn't manage to understand the
Math::abs(h) <= 1.0
case in the dead code, or find an other physics engine with a cylinder support mapping that looks like that. For example, in thep_normal
direction indicated by the raycast in the picture below, the dead code would return the red point as the support point:But the red point is not a true support point, since e.g. all the points directly above it on the cylinder surface are "more extreme" points in the
p_normal
direction (they have a higher dot product withp_normal
).For posterity I observe that$x$ -coordinate in the "otherwise" case.
GodotCylinderShape3D::get_support
(which replaces the dead code) is almost the support function from page 8 of A Fast and Robust GJK Implementation for Collision Detection of Convex Objects by Gino van den Bergen, except for (the use of!Math::is_zero_approx(s)
instead ofs > 0.0
, and) the different