dts2hx
dts2hx copied to clipboard
[ERROR] Could not resolve "three/src/math/MathUtils"
three.js 138
import three.src.math.MathUtils;
var x=180*MathUtils.DEG2RAD;
trace(x);
after compile will get this error.
X [ERROR] Could not resolve "three/src/math/MathUtils"
dist/main.js:64:39:
64 │ var three_src_math_MathUtils = require("three/src/math/MathUtils");
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~
The module "./src/math/MathUtils" was not found on the file system:
``
---------------------------
sources[ here](https://github.com/haxiomic/dts2hx/files/8264875/three138.zip)
Hmm, looks like MathUtils has two exports, both Three.MathUtils
and three/src/math/MathUtils
and dts2hx need to choose just 1
For now a quick fix would be to replace the @:jsRequire in MathUtils.hx with
@:jsRequire("three", "MathUtils")
Not ideal I know but I'll keep this issue in mind next time I work on dts2hx
@haxiomic , your suggestions were wrong.
can you debug
var x=180*MathUtils.DEG2RAD;
trace(x);
x vaule is NaN.
My bad, I copied the wrong line, should be
@:jsRequire("three", "MathUtils")
same error BufferGeometryUtils
https://github.com/haxiomic/dts2hx/issues/114
thank you .it's work.
when will you release the next version dts2hx? haha
Next version could take a while, my project schedule doesn't allow the time investment at the moment. Open to PRs if anyone want to make improvements in the near term!