[ENIGINE ONLY] pc.WasmModule for Ammo/Physics


I have a question, where I must put the scripts to get this working:

pc.WasmModule.setConfig(‘Ammo’, {

    glueUrl: '/lib/ammo/ammo.wasm.js',

    wasmUrl: '/lib/ammo/ammo.wasm.wasm',

    fallbackUrl: '/lib/ammo/ammo.js',


  pc.WasmModule.getInstance('Ammo', demo);

…and is this pc.WasmModule existing in engine?

Here’s an example I’ve put together: yaustar.github.io/physics-engine-example at master · yaustar/yaustar.github.io · GitHub

Running example: https://yaustar.github.io/physics-engine-example/

I’m not sure where pc.WasmModule comes from and will need to ask the person who put together the engine examples

Hi @yaustar Thank you very much!

I checked the engine commits, its not yet in release version https://github.com/playcanvas/engine/pull/4235

This will be a cool improvement to the engine!

Ah, that explains a lot. I was looking at main instead of the release branch. The released examples in example browser was using an external library file like I was

@yaustar Thanks for clarifying, for now I use it like you did in your example:

if (wasmSupported()) {

      modulesLoaded // Trigger event


Btw. Do you have a fair glue when the above (pc.WasmModule) will be released?

It would be released as part of v1.55 which is going to be in the next week or two

1 Like