To make available the assets Box2D.wasm and Box2D.simd.wasm. I believe the Emscripten boilerplate expects these to be served from the root of your webserver.
But as usual, you can redirect it to lookup the files from a different location, by overriding locateFile:
Box2DFactory({
/**
* This is the default implementation of locateFile.
* Modify this logic if your Box2D.wasm lives in a different directory.
*/
locateFile: (url, scriptDirectory) => `${scriptDirectory}${url}`
})
Add support for WASM SIMD.
This could make some parts of Box2D 4x faster. But probably overall performance change will not be as dramatic as that.
Serving the .wasm asset becomes a bit more complicated, because there are now two (in different directories) that will need to be served.
If you were previously serving:
You should now instead serve:
To make available the assets
Box2D.wasm
andBox2D.simd.wasm
. I believe the Emscripten boilerplate expects these to be served from the root of your webserver.But as usual, you can redirect it to lookup the files from a different location, by overriding
locateFile
: