parry icon indicating copy to clipboard operation
parry copied to clipboard

QbvhUpdateWorkspace stack depth change u8 to u16 to prevent overflow

Open honnisha opened this issue 2 years ago • 2 comments

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

honnisha avatar Oct 15 '23 16:10 honnisha

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.

axelmagn avatar Mar 08 '24 00:03 axelmagn

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.

sebcrozet avatar Mar 08 '24 09:03 sebcrozet