Hi,
There is important Navmesh functions to create advanced AI.
Many are already included in Detour Api, SKyline just needs to interface them to Lua.
findRandomPointAroundCircle
Used a lot to create dynamic AI moving everywhere around the player
dtStatus dtNavMeshQuery::findRandomPointAroundCircle(dtPolyRef startRef, const float* centerPos, const float maxRadius,
const dtQueryFilter* filter, float (*frand)(),
dtPolyRef* randomRef, float* randomPt)
raycast
Faster than physics raycast when testing environment, and usefull to identify static walls and obstacles
dtStatus dtNavMeshQuery::raycast(dtPolyRef startRef, const float* startPos, const float* endPos,
const dtQueryFilter* filter,
float* t, float* hitNormal, dtPolyRef* path, int* pathCount, const int maxPath)
getCost
Navigation cost.
Can be used to compare two possible destination cost or used for gaemplay like checking if sound propagation reaches a destination.
float dtQueryFilter::getCost(const float* pa, const float* pb,
const dtPolyRef /*prevRef*/, const dtMeshTile* /*prevTile*/, const dtPoly* /*prevPoly*/,
const dtPolyRef /*curRef*/, const dtMeshTile* /*curTile*/, const dtPoly* curPoly,
const dtPolyRef /*nextRef*/, const dtMeshTile* /*nextTile*/, const dtPoly* /*nextPoly*/)
closestPointOnPolyBoundary
Closest point into a boundary poly
dtStatus dtNavMeshQuery::closestPointOnPolyBoundary(dtPolyRef ref, const float* pos, float* closest)