Optimize shapecasting with multiple hits #403
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
Currently,
SpatialQuery::shape_hits
andSpatialQuery::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
andSpatialQuery::ray_hits_callback
.The text was updated successfully, but these errors were encountered: