Was selecting mainly for Lightweight and Ease of Use. I’m hoping to stick with purely vanilla JS as well.
I was actually deciding between Ammo, Cannon, and Oimo, and initially decided on Oimo. But stumbled on the fact Oimo has those 2 versions, and am wondering if there are any major differences between them, reasons one would be better than the other, etc. Oimo.js seems to have more examples around it, but it’s last update was a few years further back than OimoPhysics.
Rapier seems a lot more unstable in the demos compared to most others on this site. For example, the structure just collapses, while on other engines it stays in the correct shape: PHY
Also with the “start” demo, the couch just immediately drops through the floor as soon as the balls fall on top of it, while other engines don’t seem to have this issue.
Depends on your needs. If you need continuous collision detection to prevent fast moving objects from passing through walls, rapier might be your only choice. I know Ammo and Cannon don’t support this.
I’d use Havok or Ammo, but they are both pretty tricky to get rolling. But physics simulation is tricky already… and Ammo (and probably Havok even tho the wasm port is relatively recent) are super battle tested. They’re really the only JS engines I trust. All other engines I’ve tried have nice working small demos, but quickly self destruct when presented with larger simulations or more complex use cases.
Ammo aka Bullet has been used in soooo many projects that pretty much all the bugs have been hammered out. It’s still really easy to break it with incorrect code… in fact it’s almost guaranteed, but by itself it’s super robust/solid once you know what you’re doing. Memory management is a pain… as it is with all wasm style apps… but yea. just my 2c.
If you just need a character running around a map, you could also use the threejs occtree fps sample… its dead simple to get working, and really fast. https://threejs.org/examples/?q=fps#games_fps
I have used Ammo for several games and some work projects, and encountered some frustrating minor shortcomings. However, it is indeed one of the most comprehensive physics engines. Recently, I started using Havok and made a game with it, and it is indeed better.