code: public List<StraightPathItem> findCorners(int maxCorners, NavMeshQuery navquery, QueryFilter filter) {
          final float MIN_TARGET_DIST = sqr(0.01f);
          List<StraightPathItem> path = new ArrayList<>();
          Result<List<StraightPathItem>> result = navquery.findStraightPath(m_pos, m_target, m_path, maxCorners, 0);
          if (result.succeeded()) {
              path = result.result;
              // Prune points in the beginning of the path which are too close.
              for (Iterator<StraightPathItem> iter = path.iterator(); iter.hasNext();) {
                  StraightPathItem spi = iter.next();
                  if ((spi.getFlags() & NavMeshQuery.DT_STRAIGHTPATH_OFFMESH_CONNECTION) != 0
                          || vDist2DSqr(spi.getPos(), m_pos) > MIN_TARGET_DIST) {
                      break;
                  }
                  iter.remove();
              }
          }
          return path;
      }
docs: Finds the corners in the corridor from the position toward the target. (The straightened path.)
  
  This is the function used to plan local movement within the corridor. One or more corners can be detected in
  order to plan movement. It performs essentially the same function as #dtNavMeshQuery::findStraightPath.
  
  Due to internal optimizations, the maximum number of corners returned will be (@p maxCorners - 1) For example: If
  the buffers are sized to hold 10 corners, the function will never return more than 9 corners. So if 10 corners
  are needed, the buffers should be sized for 11 corners.
  
  If the target is within range, it will be the last corner and have a polygon reference id of zero.
  
  @param filter
  
  @param[in] navquery The query object used to build the corridor.
  @return Corners