Hi, when I export a project from the Editor there is this file in Zip:


I can see that main difference is the instance is called AmmoLib not Ammo.

What is it exactly? Is this a special build of Ammo.js for PlayCanvas?
I want to use the PlayCanvas npm package (npm install playcanvas)
It seems that this file is missing there…

Also there is the package npm install ammo.js but with non of their versions
PlayCanvas physics with engine only works, only with the ammo.dcab07b.js file

Can someone help or clarify, please?

Thanks a lot!

Here is a copy of ammo.dcab07b.js:


If you scroll to the bottom of the file, you will find the following line:

Ammo = AmmoLib();

ammo.dcab07b.js is just a reasonably old build of Ammo.js from the main repo:

To be specific, it’s this commit:

However, these days, we recommend you use the WASM build of ammo.js. A copy of it is checked into the engine repo here:

It’s loaded like this (if you’re using the engine without the Editor):

We do not include ammo.js in our NPM module because it’s really a separate product (and a dependency of PlayCanvas) - not a core part of it.

@will Thanks for clarifying. This is obviously not the way a frame like Vue is including this :frowning:
But I will find a workaround…

Yeah, I’m afraid I know nothing about Vue so I can’t help with that. But good luck figuring something out!

@will I now posted my solution:

1 Like