Closed gkjohnson closed 3 years ago
When testing the "coffeemat" model there's a section where the closest hit is not retrieved when raycast.firstHitOnly === true:
Specifically on this handle thing:
These are the distance differences when using firstHitOnly = false vs true:
TODO
NOTES
leftToRight
The issue is that this point being used to determine whether to run the next sibling is in world space rather than local space like the bounds:
https://github.com/gkjohnson/three-mesh-bvh/blob/9a412aa54dd9c9333b3ebad4f3a2b3159371cbdd/src/castFunctions.template.js#L132
When testing the "coffeemat" model there's a section where the closest hit is not retrieved when raycast.firstHitOnly === true:
Specifically on this handle thing:
These are the distance differences when using firstHitOnly = false vs true:
TODO
NOTES
leftToRight
bounds order check. Inverting it yields correct result