3DTilesRendererJS
3DTilesRendererJS copied to clipboard
Add callback for when all loading starts and ends
Related to #378
Such as tiles.onLoadStart
and tiles.onLoadComplete
.
This can already be implicitly done by checking the download and parse queue on every frame or in the onLoadModel
callback (only can detect on end).
Hi Garret, thanks for this great library! Could you give a brief example on how this would be accomplished via onLoadModel? How do I know the total amount of models that are going to be loaded so I can compare it with the current count? Sorry in case this is actually obvious. I just hit my quota rate limit on the google tiles API but wanted to give it a go tomorrow.
You can check the amount of models currently in the queue to be parsed or downloaded using downloadQueue.items.size
and parseQueue.items.size
. onLoadModel
is called every time a model has been downloaded and parsed so when those fields are both set to 0 you know it's complete.
What's your use case exactly? If you have a compelling one and would like to open a PR to make this more convenient I can point you in the right direction.
Thank you, that works! :) My use case is similar to here: https://github.com/NASA-AMMOS/3DTilesRendererJS/issues/378 I'm building a location based 3D editor and so I'm fetching tiles at a specified location via an Orthographic Camera.
I could certainly try, but I come from iOS development and am not too familiar with typescript.
I could certainly try, but I come from iOS development and am not too familiar with typescript.
The project is in Javascript if that changes anything. Either way up to you - also nice to have help. Happy to give feedback if you'd like to try.