[ENGINE ONLY] Get a list of loaded modules

Hi is it possible to get a list of loaded modules (like Ammo, Basis, etc) from the engine?

Hmm, I think since the modules are being loaded to the global browser window object so it’s easier to check if they are available by their module name.

if(window.Ammo){
  // it's available
}

This isn’t truly a list but since the modules are limited in number you can check each and every one and assemble your list. Hope this helps.

Thanks, this is true for Ammo, but I am using pc.basisDownload() and it seems to not add the module to the window. This function is somehow undocumented…

So digging in the Basis loader which works a bit differently than the Ammo module (creates a web worker) it seems there is a global list of the loaded modules:

I am not sure if it’s official API, keep this in mind:

image

1 Like