aframe-physics-system icon indicating copy to clipboard operation
aframe-physics-system copied to clipboard

ammo.js driver and build issues

Open hayden2114 opened this issue 4 years ago • 3 comments

I'm using the updated (17 days ago) version of ammo.js at (http://kripken.github.io/ammo.js/builds/ammo.wasm.js) and I'm getting the error TypeError: this.physicsWorld.setForceUpdateAllAabbs is not a function coming from https://cdn.rawgit.com/donmccurdy/aframe-physics-system/v4.0.1/dist/aframe-physics-system.min.js

If I use https://mixedreality.mozilla.org/ammo.js/builds/ammo.wasm.js I don't get that error but I get another error related to btRaycastVehicle not being a constructor. I'm guessing the mozilla build doesn't port over those functions.

Any help would be much appreciated and I'm happy to provide more code for context if needed!

hayden2114 avatar Apr 29 '20 00:04 hayden2114

/cc @InfiniteLee any idea on this?

donmccurdy avatar May 09 '20 22:05 donmccurdy

Just to note, I commented out the this.physicsWorld.setForceUpdateAllAabbs() function in the startup function and everything seems to be working now. I didn't see any function setForceUpdateAllAabbs() in the ammo.js idl

hayden2114 avatar May 11 '20 14:05 hayden2114

https://mixedreality.mozilla.org/ammo.js/builds/ammo.wasm.js exports only the specific functions used by the ammo-driver which includes some specific ones that http://kripken.github.io/ammo.js/builds/ammo.wasm.js does not export by default. I would recommended you either fork your own version of ammo.js with the specific functions you want, or you open a PR to have those functions added to https://github.com/kripken/ammo.js/ . https://github.com/mozillareality/ammo.js will probably not add additional functions in order to keep the build size small, unless specific functions are needed for future updates.

InfiniteLee avatar May 20 '20 21:05 InfiniteLee