NavMesh computePath always returns 4 waypoints


i try to generate a motion path from the navmesh path finder

but it always returns 4 way points ---- the two first are the start point of the spatial andthe two last are the target

even with 2 or 3 adjacent coplanar triangles, i get the same issue

here is a screenshot where the mesh is the same as the navmesh (ongoing test)

(one addtional fact is that the navmesh is not centered at location 0,0,0, but offset to a prop that is placed on the map
but so far, the random points (cyan) are located on the navmesh and the only problem is the generated path beein a straight line
instead of following the curve
if it was an issue with the slope of the mesh, then the path finder would not return any path at all (i guess) )

Vector3f startPoint = spatial.getLocalTranslation();

    //------------- random point on triangle
    int randomCell=FastMath.nextRandomInt(0, navMeshPathFinder.navMesh.getNumCells()-1);
    Cell cell=navMeshPathFinder.navMesh.getCell(randomCell);
    float r1=FastMath.nextRandomFloat();
    float r2=FastMath.nextRandomFloat();
    float sr1=FastMath.sqrt(r1);
    Vector3f target = //navMesh.getCell(randomCell).getRandomPoint();
    navMeshPathFinder.navMesh.snapPointToCell(cell, target);
        Geometry triangle1=Tools.CreateSphereNode(target,"", 0.1f, ColorRGBA.Cyan,main.getAssetManager());
    //---------------------------------------------- calc navmesh path
    Path path=null;
    DebugInfo debugInfos = new DebugInfo();
        path = navMeshPathFinder.pathfinder.getPath();
    return path;


what do i do wrong ? is this a bug ?


[edit : after verification, the debugInfos is not initiallized, all fields are null ???
is the navmesh code at its final stable version ?
i see a warp and onMove entries, it is really confusing

is there any test case/example on how to use the navmesh code ?]

@normen ? any idea ?

Navmesh traversing code is not final, no.

:frowning: sad monkey