Skip to content

Explore removing array -> box conversions#795

Open
gkjohnson wants to merge 7 commits intomasterfrom
array-box-optimization
Open

Explore removing array -> box conversions#795
gkjohnson wants to merge 7 commits intomasterfrom
array-box-optimization

Conversation

@gkjohnson
Copy link
Owner

@gkjohnson gkjohnson commented Nov 27, 2025

Related to #656

  • Adjusts shapecast to pass a buffer rather than Box3 with an option to use Box3

Remaining Issues

  • Make a bvhcast and intersects geometry PR separate from "shapecast"
    • Test performance on bvhcast, intersects geometry
  • Shapecast needs to provide unique instances of box and the bounds array to ensure recursive calls work correctly
    • Use a stack / pool
  • Test shapecast perf benefits first.

@gkjohnson
Copy link
Owner Author

cc @agargaro - awhile ago we discussed improving the performance of the "shapecast" function by allowing it to pass float32 "bounds array" rather than implicitly converting it a Box3 ahead of time. This PR makes (most of) the changes to achieve this with the "useBox3 = false" option. ClosestPointToPoint has been changed to use the bounds arrays but I'm not seeing any performance benefit compared to master. Is this along the lines of what you were thinking?

@agargaro
Copy link
Contributor

agargaro commented Dec 5, 2025

I would have expected a slight improvement, like with raycasting. I'll try running some tests locally later to understand more 😄

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