2D Rigid Body Library


Is there a recommended 2D Rigid Body Library to be used with OpenFL ? I am interested to build gear simulation, something like this https://codepen.io/liabru/pen/xxjXXp but using sprites or shape types of OpenFL.

Any advice is highly recommended.

I’ve heard good things about Nape in AS3. It appears to support Haxe and OpenFL too.

1 Like

I used box2d in as3 and don’t remember having to complain about it. There is a haxe version : https://lib.haxe.org/p/box2d/

You will probably need something like CodeAndWeb’s PhysicsEditor : https://www.codeandweb.com/physicseditor

Just found documentation for box2D Box2DFlash it seems to support gears as well :heart_eyes:

I was speaking about box2d yes, I used it with PhysicsEditor years ago and it worked well. I never pushed a lot on physics though so I can’t comment much.

Nape’s repo not being updated for a long time could be because there is nothing to update ? Nape has been out there for quite a while

Yea, but for box2d am I right that it does not support HTML5 ?

Probably yes, I only used the as3 version I don’t know about the haxe one. I guess if it supported html5 target then it would be advertised as such ?

Yes, I found this discussion , I don’t think its easy to integrate box2d.js into an existing openFL project…

I have this collection of physics links for Haxe. Some are 3D.