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

Optimize shapecasting with multiple hits #403

Open
Jondolf opened this issue Jul 6, 2024 · 0 comments
Open

Optimize shapecasting with multiple hits #403

Jondolf opened this issue Jul 6, 2024 · 0 comments
Labels
A-Spatial-Query Relates to spatial queries, such as ray casting, shape casting, and intersection tests C-Performance Improvements or questions related to performance

Comments

@Jondolf
Copy link
Owner

Jondolf commented Jul 6, 2024

Currently, SpatialQuery::shape_hits and SpatialQuery::shape_hits_callback can compute multiple hits by performing multiple best-first traversals in a loop. At each iteration, the entity that was hit is added to the excluded entities so that it gets filtered in the next iteration.

This is inefficient. The methods should be changed to only traverse the QBVH acceleration structure once, potentially with a depth-first traversal like SpatialQuery::ray_hits and SpatialQuery::ray_hits_callback.

@Jondolf Jondolf added C-Performance Improvements or questions related to performance A-Spatial-Query Relates to spatial queries, such as ray casting, shape casting, and intersection tests labels Jul 6, 2024
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-Performance Improvements or questions related to performance
Projects
None yet
Development

No branches or pull requests

1 participant