Closed Smoozilla closed 5 years ago
You can use OimoPhysics for all platforms, directly. These macros help compile it into a JS file, but never prevent from compiling it into other formats than JS. Otherwise it's a bug so I'd try to fix it. Thanks,
Thank you for the reply, and the project.
I'm having difficulty trying to compile the library to JavaScript, I would like to bypass all the macros and ultimately compile into Typescript, something similar to this process: https://bitbucket.org/yar3333/haxe-nodegen
Can you advise me the best way to get this compiled as a Typescript library? I am using the physics on the server side as well, and among other reasons, it would be ideal.
Thanks again!
I think it's difficult to bypass all the macros in the codes, especially build macros that edit the syntax tree (parsed by the compiler) to add or remove local/class fields before its semantic analysis is done.
I'm not good at TypeScript so I don't know what is the best way to convert it, but some advice is like:
Actually the current heavy usage of build macros somewhat differs from what I expected first; it was adopted in order to make the most of SIMD in JavaScript in future, and now SIMD in JavaScript is not likely to be widely introduced :( So I may get rid of those macros in the next major update and implement some more memory management systems instead.
Thanks!
Again thank you for everything, this rendition of OIMO is by far my favorite physics engine available in JavaScript.
I am running it on the node side, and sticking to pure NodeJS for the project, transpiling for the client. I've done a few edits on the offered binary and it works fine, though not as elegant as if it were a node module I could npm install. TypeScript would be nice but personally at this point I'm far enough into the JavaScript I'd like to revoke my TS vote. :grin:
I would like to use this library to compile to native android via lime, yet I've found the code is riddled with build macros to turn it into a JavaScript file.
Can I use this library directly in a Haxe project? Thanks.