Skip to content

Conversation

@sebcrozet
Copy link
Member

@sebcrozet sebcrozet commented Jul 11, 2025

Replace the hierarchical SAP broad-phase by a broad-phase based on parry’s new BVH structure.

The QueryPipeline is now and ephemeral object obtained from the broad-phase with broad_phase.as_query_pipeline(). It no longer needs to be updated separately from the broad-phase.

Since there is no longer any need to update a QueryPipeline separately from the broad-phase, this offers a substantial performance improvement on scenes with a large number of objects where rebuilding the QueryPipeline from scratch would be very expensive.

Currently, the new broad-phase does a little bit more work than what it should to overcome the fact that the narrow-phase hasn’t been designed to not receive any collision-end event from the broad-phase yet. This will be subject to future work.

Note that a large part of this PR modified lines are from cargo fmt which apparently changed its way of sorting use imports.

@sebcrozet sebcrozet merged commit 95bd6fc into master Jul 11, 2025
8 checks passed
@sebcrozet sebcrozet deleted the sah-broad-phase branch July 11, 2025 20:36
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