Physics engines still under development

Hello there, after using BabylonJS for various purposes, I will like to try to make a simple 3d modeling web app, and I was wondering if the physics engines supported by BabylonJS are still under active development, because I see from their github repositories that the last commits are very old. Am I going in the right path or is it better to think about using a game engine that has better support for this kind of problems?

Thank you

Sebastiano

1 Like

Hi,

we support Oimo (not being actively developed), cannon (same) and ammo (which is a port of bullet, a wonderful c+±based physics engine, with the last version released in nov 2020).
They are all stable. I would recommend Cannon and Ammo, because IMO they provide the best results and have the lest amount of glitches.

1 Like

There are also talks about integrating Rapier into Babylonjs but I think that doesn’t come around that soon :slight_smile:

Best bet for now would be in my opinion to use Ammo.js, but it is a bit older version and has a few issues as well. If your project uses typescript and modern project setup in general (esm), use this package: ammojs-typed - npm

3 Likes

Hey @seba80 welcome!
You can still use any physics engine directly without utilizing BabylonJS"s physics impostors.

Rapier from what I understand is pretty awesome. It has allot of the capabilities of PhysX 4.x and Is much lighter on the CPU.

4 Likes

But using a physics engine without the impostors of BabylonJS could be the right path? I mean, am I losing much of the capabilities of the BabylonJS apis or is something I could try to do?

Thank you again for your help

Sebastiano

I think without the impostors you’ll have to update your objects’ positions and other parameters manually, but let’s just check with @RaananW

You can, of course, integrate your own physics engine. You can use the before render observable of the scene to run the physics engine’s step, and then update the meshes manually. What you are losing is the automated physics engine integration. Apart from that everything related to rendering should work without a problem.