implicit-invocation / jwalkable

Easy 2D polygonal pathfinding for Java.
Other
26 stars 8 forks source link

No path generated #2

Closed assofohdz closed 7 years ago

assofohdz commented 7 years ago

Hi,

I just tried jwalkable and it seems cool with how simple it is. But when I try, it doesn't generate any path for me. I tried this:

    float width = 100;
    float height = 100;
    pathHelper = new PathHelper(width, height);

    float rectX = 2;    
    float rectY = 2;
    float rectW = 1;
    float rectH = 1;
    pathHelper.addRect(rectX, rectY, rectW, rectH);

    FloatArray testPath = new FloatArray();        
    Vector2f start = new Vector2f(0,0);
    Vector2f end = new Vector2f(10,10);
    pathHelper.findPath(start.x, start.y, end.x, end.y, 1, testPath);

And the testPath is empty

assofohdz commented 7 years ago

Nevermind, that's just my error. I had start being on the edge, so the radius of the agent obviously didn't allow any path. It works.