Closed neilrackett closed 4 months ago
This should work just fine and have no impact on the generation time of the BVH itself. Do you have a live example using something like jsfiddle showing the issue?
I'll put a fiddle or similar together -- is there an existing template I can use that takes care of the boilerplate?
This official three.js one is a reasonable one to start with:
OK, so it works fine in a fiddle, so looks like the issue is somehow specific to our viewer / models.
I'll post an update here if I identify a real bug 😉
We're using BVH to boost the performance of a small number of features in a larger app, computing the bounds tree before adding the associated mesh to either a group or a scene. This works well, but adds time at startup for something that may never get used.
What I'd like to do is compute the bounds tree, either using a Worker or on-demand, after a mesh has been added to a group and/or scene, but find that running
computeBoundsTree()
ornew MeshBVH(geom)
after the associated mesh has been added to something else, even if it hasn't been added to the scene, the script just hangs. Forever.So I just wanted to ask if this is actually possible?
Example