Closed honnisha closed 3 months ago
bump on this? I think it would fix #146, and no discussion for half a year. I just wrote a similar patch before seeing that there's already an open PR.
Unfortunately, this is not a valid fix. The problem here is that the incremental update tends to make the tree more progressively more degenerate (increasingly deep). Changing the depth type only hides the actual problem. A fix here needs to rework the way rebalancing is implemented.
QbvhUpdateWorkspace stack depth can be more than 255, so I changed u8 to u16.
After this change, I no longer received the error:
attempt to add with overflow
on the line:workspace.stack.push((child, depth + 1));
Related error: https://github.com/dimforge/rapier/issues/532