// nav_query.inl - what a navmesh answers: the nearest point on it, a path as corner points, and // whether a straight line stays on it. Points go out through out[] (x, y, z each). static dtPolyRef nav_poly_at(Nav *n, const float *p, float *on) { dtPolyRef r = 0; if (dtStatusFailed(n->query->findNearestPoly(p, n->ext, nav_filter(n, 0), &r, on))) return 0; return r; } // the nearest point on the mesh to (x, y, z) into out; 0 when none is within reach NAV_SHIM int nav_nearest(void *h, float x, float y, float z, float *out) { float p[3] = {x, y, z}; return nav_poly_at(static_cast