Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Take SpatialQueryFilter by reference in spatial queries #402

Merged
merged 5 commits into from
Aug 10, 2024

Conversation

Jondolf
Copy link
Owner

@Jondolf Jondolf commented Jul 6, 2024

Objective

Spatial queries currently take SpatialQueryFilter by value and clone it several times. This could sometimes be cloning a pretty hefty amount of data if the HashSet of excluded entities is large.

Solution

Take spatial query filters by reference and reduce the amount of cloning.

Future Work

Shapecasting with multiple hits should be optimized to only traverse once instead of doing best-first traversals in a loop. See #403.


Migration Guide

Spatial queries performed through SpatialQuery now take SpatialQueryFilter by reference.

@Jondolf Jondolf added A-Spatial-Query Relates to spatial queries, such as ray casting, shape casting, and intersection tests C-Breaking-Change This change removes or changes behavior or APIs, requiring users to adapt labels Jul 6, 2024
Copy link
Contributor

@janhohenheim janhohenheim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh nice, you managed to make all of the spatial queries take the filter by reference!

@Jondolf Jondolf merged commit 73fe6c7 into main Aug 10, 2024
4 checks passed
@Jondolf Jondolf deleted the query-filter-by-reference branch August 10, 2024 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Spatial-Query Relates to spatial queries, such as ray casting, shape casting, and intersection tests C-Breaking-Change This change removes or changes behavior or APIs, requiring users to adapt
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants