code: public static void buildDistanceField(Context ctx, CompactHeightfield chf) {
  
          ctx.startTimer("BUILD_DISTANCEFIELD");
          int[] src = new int[chf.spanCount];
          ctx.startTimer("DISTANCEFIELD_DIST");
  
          int maxDist = calculateDistanceField(chf, src);
          chf.maxDistance = maxDist;
  
          ctx.stopTimer("DISTANCEFIELD_DIST");
  
          ctx.startTimer("DISTANCEFIELD_BLUR");
  
          // Blur
          src = boxBlur(chf, 1, src);
  
          // Store distance.
          chf.dist = src;
  
          ctx.stopTimer("DISTANCEFIELD_BLUR");
  
          ctx.stopTimer("BUILD_DISTANCEFIELD");
  
      }
docs: / @see rcCompactHeightfield, rcBuildRegions, rcBuildRegionsMonotone