Haxe externs for three.js (release 47).
Please fork and contribute as I may not maintain it in the long run :)
If you meet me, buy me a beer. If you don’t think you are going to meet me, think about a little donation so I can buy my Humble Bundles :)
Laurent
haxelib install three.js
git clone git@github.com:labe-me/haxe-three.js.git zip -r haxe-three.js.zip haxe-three.js haxelib test haxe-three.js.zip haxelib dev three.js `pwd`/haxe-three.js
Regular usage will embed three.js minified javascript:
haxe -lib three.js ...
Debug compilation will embed non-minified javascript (easier to debug):
haxe -lib three.js -debug ...
To avoid embedding javascript (don’t forget to include three.js javascript manually inside your HTML):
haxe -lib three.js -DnoEmbedJS ...
Take a look at the examples for some code ported from original three.js examples.
Haxe modify some javascript prototypes and create a few incompatibilites.
Here’s a list of things to care about:
- Array prototype is modified which affect the “for v in someArray” javascript behaviour
- Date.now is overriden by haxe, the new method returns a Date object instead of the regular time stamp, this is bad and must be adressed.
Important: The three.js haxelib package provides a modified Date.hx and haxe/Timer.hx to fix the Date.now() problem.