// nav_tiles.inl - a map as square tiles: a tiled mesh, one tile built from the triangles under it // and a border round it, and every tile written and read back as one set of bytes // an empty mesh of tiles `tile` metres across, the first at (ox, oz) NAV_SHIM void *nav_tiled(float ox, float oz, float tile, int max_tiles, int max_polys) { dtNavMeshParams p; memset(&p, 0, sizeof(p)); p.orig[0] = ox; p.orig[1] = 0.0f; p.orig[2] = oz; p.tileWidth = tile; p.tileHeight = tile; p.maxTiles = max_tiles; p.maxPolys = max_polys; dtNavMesh *mesh = dtAllocNavMesh(); if (!mesh || dtStatusFailed(mesh->init(&p))) { dtFreeNavMesh(mesh); return nullptr; } return nav_open(mesh); } // tile (tx, tz) built from triangles that cover it and a border of the walker's radius and three // cells round it, replacing whatever was there; its polygons, 0 for none, -1 when it failed NAV_SHIM int nav_tile_build(void *h, int tx, int tz, const float *v, int nv, const int *t, int nt, const unsigned char *area, const float *cyl, int nc, const float *foot, int nf, const float *c) { Nav *n = static_cast