2D Rigid Body Library

Hello

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.

Box2D

http://www.joshuagranick.com/blog/2011/10/28/simple-box2d-example-as3-and-haxe-side-by-side

Nape
http://code.google.com/p/nape/

Oimo

https://vujadin.github.io/Away3D_with_OimoPhysics/demo/index.html

Others

http://code.google.com/p/wow-engine-haxe/
http://allanbishop.com/fizzx/

2 Likes