I decided to add a topic here on this manner, since I’m a bit worried on the physics engine integrations / plugins of today’s Babylon.js. This is mostly to add conversation on the topic in one place. Hopefully it hasn’t been done in some other place .
There are two concerns that I have on the current state physics engine state:
- Current physics engines (Ammo.js, Cannon.js, Oimo.js) are not maintained. And that kind of means that all the bugs will be there forevermore… For example, I think it is still a problem that physics objects can’t enter sleep state, in at least Ammo.js, which unfortunately happens to be the most performant of the current engines. And Ammo.js creator doesn’t work on the project anymore.
- The npm packages are all over the place, so actually adding an physics engine to a modern Babylon.js project with es modules and TypeScript is a hassle. For example, ammo.js - npm is not what you would want, but this ammojs-typed - npm. However, this might differ from the original package…
Well, how about some solutions? Here are some alternatives that I came up with:
- Maintain an own “Ammo.js” port of the Bullet engine, with TypeScript and support for es modules.
- Use a new physics engine that is well maintained, for example:
- Maintain own Physx wasm/js port. Most work?
I would very much like to hear what the future plan for the physics integrations would be… Are there more solutions that what I’ve presented? Is there already an official plan in motion? Anyway, I think discussion on this matter is welcome Cheers!