Skip to content

Fix leaf traversal yielding non-passing leaves#372

Merged
sebcrozet merged 5 commits intodimforge:masterfrom
izzymg:master
Sep 5, 2025
Merged

Fix leaf traversal yielding non-passing leaves#372
sebcrozet merged 5 commits intodimforge:masterfrom
izzymg:master

Conversation

@izzymg
Copy link
Contributor

@izzymg izzymg commented Aug 13, 2025

When iterating leaves, the iterator did not check the parent node against the check closure. This caused leaves that did not pass AABB intersection tests to still be yielded during BVH checks, for example.

@sebcrozet
Copy link
Member

Thank you for this PR! While the proposed fix does work, it will result in most leaf being checked twice (since the iterator already checked them once before they get pushed into the stack).

The actual bug was that the first two nodes (at the root) pushed into the stack were not checked. So if they were leaves, these first two leaves would be left unchecked.

I modified the fix to add the missing check for the root nodes.

@sebcrozet
Copy link
Member

Clippy will be fixed in #377

@sebcrozet sebcrozet merged commit ea84f40 into dimforge:master Sep 5, 2025
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants