Repository navigation
overlap_shape copies the proxy's points before testing - #105
Merged
Merged
Conversation
A proxy made by make_shape_proxy for a sphere or capsule points into the sphere module's per-worker scratch, and overlap_sphere / overlap_capsule build their own shape's proxy in that same scratch before GJK reads the given one: the shape was tested against a copy of itself, so a ball far away overlapped (shape.overlap_shape, and through it the world and body overlap queries, for every shape after the first sphere or capsule). The reference's proxies point into the shapes and share nothing. Now overlap_shape copies the given proxy into its own buffer first, as shape_cast_shape already did. test_shape's test_overlap_own_proxy: a proxy made from a ball at the origin against a ball and a capsule 10 m away -- apart (main: touching). Found by an audit of the shape queries against Box3D e77352c, otherwise faithful.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
I audited the shape queries against Box3D
e77352c: sphere and capsule geometry, the shape-level dispatch, and the compound queries. All of it matches upstream except this one defect.The bug: a proxy built by
make_shape_proxyfor a sphere or capsule points into the sphere module's per-worker scratch.overlap_sphereandoverlap_capsulebuild their own shape's proxy in that same scratch before GJK reads the given one, so the shape was tested against a copy of itself. A ball 10 m away reported as overlapping. This affectsshape.overlap_shapeand, through it, the world and body overlap queries, for every shape visited after the first sphere or capsule. Upstream's proxies point straight into the shapes and share nothing.The fix:
overlap_shapecopies the given proxy into its own buffer first, asshape_cast_shapealready did.test_shape's newtest_overlap_own_proxymakes a proxy from a ball at the origin and tests it against a ball and a capsule 10 m away. Both are reported apart now; on main both report overlapping.All 28 test programs pass locally on aether 0.772.0, with no warnings.