kripken / ammo.js

Direct port of the Bullet physics engine to JavaScript using Emscripten
Other
4.08k stars 552 forks source link

`apply()` method not found when testing in BabylonJS #294

Open kerihobo opened 4 years ago

kerihobo commented 4 years ago

Sorry, this is my first time logging an issue on GitHub, so maybe this is not the place to speak about the issue I'm having. I'll learn. I implemented ammo.js in a BabylonJS project which you can find here:

If you see how I've implemented this in the smallest project I can fathom, the ammo branch is where I've tried to do this.

It was working a week ago. Occasionally I tend to run git clean -fdx && git reset --hard when I return to projects and in this case ammo no longer worked after running npm i.

I can only recommend seeing the project itself for the implementation, but I'm sure I did everything by the book. with only this simple code which only tries to make use of Ammo from the plugin:

image

I get the following error:

image

I'm wondering has anything changed? My package.json just pulls from this repo at its latest I think.

kripken commented 4 years ago

The only change I can think of is that at some point we made the API async (Ammo().then(..)). See the tests and examples for working code to compare against, like https://github.com/kripken/ammo.js/blob/master/tests/basics.js#L1