Hi,
I’ve been trying to find the documentation for the SceneLoaderProgressEvent, which is passed into the onProgress callback in the following method SceneLoader - Babylon.js Documentation but i can’t seem to find it. It’s also been linked here Create a custom loading screen - Babylon.js Documentation at the very bottom in the " Getting File Loading Rate" section but the link seems to be outdated. Could you show me where the documentation is? Thanks in advance!
1 Like
Hi,
What exactly do you need?
The interface’s code structure is this:
/**
* Interface used to represent data loading progression
*/
export interface ISceneLoaderProgressEvent {
/**
* Defines if data length to load can be evaluated
*/
readonly lengthComputable: boolean;
/**
* Defines the loaded data length
*/
readonly loaded: number;
/**
* Defines the data length to load
*/
readonly total: number;
}
It is a POJO, passed to the onProgress function every time the progres can be updated.
Thanks for the reply,
I was wondering what’s the case where the length can’t be computed? Because as we can see here Create a custom loading screen - Babylon.js Documentation in the “Getting File Loading Rate” section, they’ve separated it into different cases and if the length isn’t computable they divide by (1024 * 1024) what’s the rational behind dividing exactly by 1024 * 1024?
1 Like
Depending on server/browsers, we sometimes even more in older browsers, are not getting any data helping us with the computation.
1 Like
I understand, thanks for the reply. Do you have any clue as to why the example uses 1024 * 1024?
1 Like
Bytes to Mega Bytes conversion
I guess.
2 Likes