Hi, I have a large number of meshes that I want to clone and merge together. I have tried both sps and the usual for loop mesh.clone + mergemeshes method. However, in both cases, the operation causes a ‘blip’ on the running operations on screen. Is there a way I could have the mesh cloning and merging done asynchronously w/o blocking my main loop within bjs ?
Welcome in the fantastic world of JavaScript
There is only one thread
So no, there is no way. You need to split the work into small chunks
okie, thks.
Put clone and merge logic into a worker;
- Using the
NullEngine - Post
JSON.stringify(mergedmesh)to main.
In the main thread,
- Deserialize via
SceneLoader.ImportMesh('', '', 'data:' + ..)
Done. 