saharan / OimoPhysics

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

Field index for polarCoord not found on prototype oimo.dynamics.common.DebugDraw #8

Closed shintiger closed 6 years ago

shintiger commented 6 years ago

I have update to Haxe 4.0.0 preview-1, do you have idea this error when compiling?

saharan commented 6 years ago

I overlooked the error as I'm using Haxe 4.0.0-preview.2. I've just tried 4.0.0-preview.1 and the error could be fixed by commenting out @:extern just before the method:

    // @:extern // uncommenting this line causes error in version 4.0.0-preview.1
    inline function polarCoord(origin:Vec3, x:Vec3, y:Vec3, r:Float, theta:Float):Vec3 {
        var v:Vec3 = cartesianCoord2D(origin, x, y,
            r * MathUtil.cos(theta),
            r * MathUtil.sin(theta)
        );
        return v;
    }

I'm planning to apply this change to the next release.