How to Use Builtin function if it has an Identical public and private implementation?

DtNavMesh has a function getTilesAt(). I am trying to use this in order to access all Tiles of all layers inside of an arbitrary grid location. So that I can check to see if has any Polys and make sure it is valid.

My Issue is that this function has both a private and public implementation that seem identical or at least have identical signatures.

When I go to try and use the function my compiler switches from thinking it is public to private and then yells at me. How do I explicitly call the public version?



The function is overloaded by virtual of the tiles member being a dtMeshTile const** in one case and a dtMeshTile** in the other (lacking the const). Arguably the private one doesn’t need the NAVMESH_API macro)

It’s a bit of a poorly designed API, it’s not great to have overloads cross the private/public boundaries like this.

A quick search found this in RecastNavMesh.cpp:

TArray<const dtMeshTile*> Tiles;
Tiles.AddZeroed(MaxTiles);
const int32 NumTiles = ConstDetourNavMesh->getTilesAt(TileX, TileY, Tiles.GetData(), MaxTiles);

which should be calling the right one. Again, the minor difference in the extra const in the example versus yours.

It’s been a while but yeah I was able to solve it at the time and it was by adding const.

I noticed shortly after posting and tried to cancel or delete the thread but it was my first time making one so I didn’t know how.

int32 TileCount = NavMesh->getTileCountAt(x, y + i);
dtMeshTile const **  TileArrayPtrs = new const dtMeshTile*[TileCount];
int AllTheTiles = NavMesh->getTilesAt(x,y + i, TileArrayPtrs, TileCount);

Is what I found when checking back on my code. Thank you so much for taking the time though to go check.

I just needed to take a step back and take a break to see it with fresh eyes.

But It’s probably useful for others. Rider was leading me astray a bit on this one. And I’m sure other people’s IDEs have done similar.

Thank you again.