Skip to content

Create thread-local contact status bit vecs with correct block count#686

Merged
Jondolf merged 1 commit intomainfrom
fix-bit-vec-init
Apr 1, 2025
Merged

Create thread-local contact status bit vecs with correct block count#686
Jondolf merged 1 commit intomainfrom
fix-bit-vec-init

Conversation

@Jondolf
Copy link
Member

@Jondolf Jondolf commented Mar 31, 2025

Objective

Fixes #687.

The narrow phase is currently initializing the thread-local contact status bit vectors with a block count of zero. This means that for the first tick, contact status changes might not be tracked correctly. The bitwise OR to combine the bit vectors also currently panics with debug assertions enabled, because the sizes of the vectors don't match.

Solution

Initialize thread-local contact status bit vectors with the correct block count.

I also improved the error message for the debug assertion in BitVec::or.

@Jondolf Jondolf added C-Bug Something isn't working A-Collision Relates to the broad phase, narrow phase, colliders, or other collision functionality P-Crash A sudden unexpected crash labels Mar 31, 2025
@Jondolf Jondolf added this to the 0.3 milestone Mar 31, 2025
@Jondolf Jondolf merged commit 58a3662 into main Apr 1, 2025
5 checks passed
@Jondolf Jondolf deleted the fix-bit-vec-init branch April 1, 2025 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Collision Relates to the broad phase, narrow phase, colliders, or other collision functionality C-Bug Something isn't working P-Crash A sudden unexpected crash

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Panic in collision narrow phase after upgrade to bevy 0.16.0-rc.3

1 participant