Hello,
I am working with Cesium and loading a GLB model using the Entity API. Since the model resource is hosted online, the downloading and loading can take some time. I have subsequent operations that depend on the model being fully loaded, and hence, I need to ascertain the exact moment when the model has been fully loaded into the scene.
I have explored the following approaches:
- Polling certain attributes of the Entity, such as
position
. However, I realized this isn’t a reliable indicator, as theposition
attribute might be set even before the model is actually rendered. - Using the
Primitive
API since it offers thereadyPromise
. But I’m more inclined to stick with the Entity API as I have already written a substantial amount of code based on it. Transitioning to thePrimitive
API would require significant refactoring, which is not only inconvenient but could also introduce new challenges. - Manual, visual confirmation, but this isn’t an automated solution.
My question is: Is there a way (perhaps an event, flag, or another method) to determine when a model loaded via the Entity API has fully loaded? Or are there recommended approaches to handle this asynchronous loading scenario?
Thank you for your assistance!