saharan / OimoPhysics

A cross-platform 3D physics engine
MIT License
863 stars 68 forks source link

OimoPhysics for NodeJS #11

Closed anemol closed 4 years ago

anemol commented 6 years ago

What would interest me is to be able to run OimoPhysics with NodeJS on the server side, and not just only on the client side (browser). There is already a module for NodeJS (https://github.com/lo-th/Oimo.js/) but it is out of date, so it isn't interesting. It is best to be synchronized with the original project.

I don't know Haxe at all but i see that there is a library to create modules for NodeJS: https://github.com/HaxeFoundation/hxnodejs

So, i guess is possible to generate a module for NodeJS.

On Linux, i cloned OimoPhysics github, installed Haxe and hxnodejs. But i don't know how to compile/export OimoPhysics from the sources.

If i check the hxnodejs documentation, is like this line: haxe -lib hxnodejs -main Main -js main.js

But i don't see any "main" in the OimoPhysics sources.

kevzettler commented 5 years ago

A package.json file would need to be added to the root directory of the repo.

the main field should point to the exported module, like: "main": "bin/js/OimoPhysics.js"

OimoPhysics.js would have to be formatted correctly for ES6 export.

mrEuler commented 4 years ago

25 In that PR also oimo is exported as es6 modules