ammo.js icon indicating copy to clipboard operation
ammo.js copied to clipboard

Error with PhysiJS

Open log4b0at opened this issue 7 years ago • 2 comments

Hello, I use the Physi.js library for Three.js, the library has not been updated for a while now, I changed the old Ammo into Ammo() in the physijs_worker.js, I use the WASM version of Ammo.js, I get an error that seems to come from Ammo: (from ammo.wasm.js:326 at the apply call)

Uncaught TypeError: Cannot read property 'apply' of undefined   
    at Ammo.b._emscripten_bind_btVector3_btVector3_3 (ammo.wasm.js:formatted:3597)
    at Object.n [as btVector3] (ammo.wasm.js:formatted:4893)
    at Object.public_functions.init (physijs_worker.js:246)
    at self.onmessage (physijs_worker.js:1412)

How can i solve this problem? Thank you

log4b0at avatar May 21 '18 10:05 log4b0at

One possible issue is that wasm startup is asynchronous. See the example code for the async API: https://github.com/kripken/ammo.js/blob/master/examples/webgl_demo/worker.js#L6

kripken avatar May 21 '18 17:05 kripken

@log4b0at Hello! You may try ammonext builds, as we added features that were required by PhysiJS or physics-module-ammonext for WhitestormJS framework: https://github.com/WhitestormJS/AmmoNext/tree/master/builds

sasha240100 avatar Jun 07 '18 09:06 sasha240100