The await Ammo()
fix above was inspired by @MackeyK24’s post: Use wasm version of ammo.js and also the official Ammo example: ammo.js/worker.js at master · kripken/ammo.js · GitHub
I wonder if the developer should call await Ammo()
(or Ammo().then()
) or if Babylon should abstract this away from the developer in its AmmoJSPlugin
I was eventually hoping to load the .wasm variant of Ammo, so maybe allowing the developer to explicitly call Ammo().then()
is beneficial
For reference, to load the .wasm variant, I think we could use ammo.js/worker.wasm.js at master · kripken/ammo.js · GitHub :
var config = {
locateFile: () => '../../builds/ammo.wasm.wasm'
}
Ammo(config).then(function(Ammo) {
});