Why is there no 3D physics engine for Haxe?

First of all, hi all, this is my first post

Tag: 3d

So, am I missing something? It seems there’s barely one, there’s oimophysics which is 10 years old and seems incomplete but works for limited use cases as far as I can tell… Haxebullet is incomplete too, and just as old, maybe I managed to make it work I don’t remember I just remember I settled for oimophysics back when I was testing/looking for 1.

It’s to use with away3D btw

Heaps, Kha and one that is being developed on the discord called Cortex.

1 Like

Heaps is a pain to set up and run on linux last time I tried, I succeeded but it took a while, lots of trial and errors, but I failed to install HashLink, not sure it’s any better nowadays.

I think Jarrio misunderstood your question, but Oimo seems to be pretty complete? As far as I know Cortex Engine is planning to make C++ bindings for JoltPhysics, so might be worth waiting for those (or writing your own!)

1 Like

or writing your own!

Well, I started contemplating the idea a couple of months ago (porting an already existing one), but then I asked myself “How comes nobody did it already?” see what I mean? It’s not like there’s only one coder on earth, haxe is a cross platform multi target tech, so… Obviously, somebody would have done that already if there wasn’t a catch somewhere… That’s what I concluded, there may be a catch, something, a technicality that becomes painfully obvious only once it’s right in front of your face and then you think “now I understand why nobody did it already…”

For now I only have oimophysics and I could just settle for it, but it doesn’t handle terrains for instance, there’s nothing for that, only primitives… I guess I could learn to live with it, find a not so glorious workaround, but I would prefer to use a tool that just can handle terrains nice and easy in the first place, that would be nice.

Not sure how constrains work also, like for car wheels for instance, not even sure there’s anything to handle them with haxe’s oimophysics version…

So, there’s that

Oops, completely missed the word “physics” - my bad

There is a pretty good extern available for Nvidia PhysX4 GitHub - undefinist/physxhx: Haxe/hxcpp @:native bindings for PhysX

With some work you can make it work with PhysX5. Note that these externs are only for hxcpp and not HashLink.

1 Like

The Haxe community is relatively small. If you’re coming from a super big ecosystem like JavaScript or Unity, you might be used to finding a ton of libraries already available. In the Haxe community, it’s more likely that there will be gaps where libraries for certain things are missing or incomplete.

Personally, I wouldn’t assume that there’s a catch. I would assume that existing projects like OimoPhysics have simply been good enough for what folks have needed so far. If you take the time to port something better, I’m sure that the community will appreciate it!

2 Likes

I tend to collect links for such things. Oimo does seem to be the best for Away3D. I’ve had successful experiments with it.

Using OimoPhysics with Away3D Away3D Basic View
GitHub - saharan/OimoPhysics: A cross-platform 3D physics engine
GitHub - vujadin/Heaps_with_OimoPhysics: Using OimoPhysics with Heaps https://vujadin.github.io/Heaps_with_OimoPhysics/demo/index.html

1 Like

Apparently for Heaps there is GitHub - luboslenco/jiglibhx: 3D Physics Engine ported to Haxe

1 Like

Yeah that’s pretty much where I ended up landing, I’ve combined away3D and oimo using haxelib’s versions and compiled for desktop and it works. And that demo here GitHub - vujadin/Away3D_with_OimoPhysics: Using OimoPhysics with Away3D https://vujadin.github.io/Away3D_with_OimoPhysics/demo/index.html is pretty much all you can get with it as far as I can tell, there’s nothing to handle collision with an away3D generated heightmap terrain for instance, which is unfortunate. I tried to hack my way around it but that’s dirty especially when it comes to getting proper bouncing and frictions according to terrain’s slopes, it’s a mess.