Repository navigation
Conversation
leaf_pairs seeded its traversal with the root-level node pairs without calling check on them, so a pair of root leaves was yielded even when check rejected it. run check on every seeded pair, like Leaves::new does for the single-tree iterator, and add a regression test. Fixes dimforge#461 Signed-off-by: Dundy Pasupuleti <dundysm@gmail.com>
Author
|
@sebcrozet small fix for #461; |
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.
fixes #461
what
Bvh::leaf_pairsseeded its traversal with the root-level node pairs (nextplus up to three stack entries) without callingcheckon them.LeafPairs::nextreturns any leaf/leaf pair it pops, so for trees of one or two leaves, or trees whose root has a leaf child, pairs thatcheckrejects were yielded anyway. with the report's two disjoint trees it returned[(0, 0), (1, 0), (1, 1), (0, 1)]instead of[].this runs
checkon every seeded pair before it is queued, the same wayLeaves::newalready does for the single-tree iterator (#372). the seedednextalso requires both left roots to hold a leaf, so an empty root never comes out as a pair.tests
test_leaf_pairs_checks_root_pairsinbvh_tests.rs: disjoint trees of 1, 2 and 3 leaves yield nothing, and partially overlapping trees (1x1 up to 16x9 leaves) match a brute-force aabb check. it fails on master (1 leaves: unexpected pairs [(0, 0)]) and passes with the fix.cargo test -p parry3d --lib(81 passed),cargo test -p parry2d --lib(98 passed),cargo test -p parry2d-f64 --lib bvh(5 passed).