gkjohnson / three-mesh-bvh

A BVH implementation to speed up raycasting and enable spatial queries against three.js meshes.
https://gkjohnson.github.io/three-mesh-bvh/example/bundle/raycast.html
MIT License
2.5k stars 260 forks source link

BVH Workers: sometimes the onProgress value is > 1 or never reaches 1 #653

Closed gkjohnson closed 5 months ago

gkjohnson commented 6 months ago

Possibly because the final value is over or slightly off of 1.0 due to error? But unclear where it's coming from exactly.

if ( currTime - prevTime >= 10 || progress === 1.0 ) {

It's possible we should just dispatch the 1.0 value after completion to ensure it gets fired.