![]() |
ezEngine Release 25.08
|
Allows to do queries on a navmesh. More...
#include <NavMeshQuery.h>
Public Member Functions | |
ezAiNavMesh * | GetNavmesh () const |
void | SetNavmesh (ezAiNavMesh *pNavmesh) |
Sets on which navmesh to do the queries. | |
void | SetQueryFilter (const dtQueryFilter &filter) |
Sets the filter to use on the navmesh to ignore certain areas. | |
bool | PrepareQueryArea (const ezVec3 &vCenter, float fRadius) |
Checks that the given area of the navmesh is loaded, such that query results are useful. | |
bool | Raycast (const ezVec3 &vStart, const ezVec3 &vDir, float fDistance, ezAiNavmeshRaycastHit &out_raycastHit) |
Does a raycast along the navmesh from the start position into a given direction. | |
bool | FindRandomPointAroundCircle (const ezVec3 &vStart, float fRadius, ezRandom &ref_rng, ezVec3 &out_vPoint) |
Attempts to find a random point on the navmesh. The circle limits which navmesh polygons are visited. | |
Allows to do queries on a navmesh.
bool ezAiNavmeshQuery::FindRandomPointAroundCircle | ( | const ezVec3 & | vStart, |
float | fRadius, | ||
ezRandom & | ref_rng, | ||
ezVec3 & | out_vPoint | ||
) |
Attempts to find a random point on the navmesh. The circle limits which navmesh polygons are visited.
The result may be outside the circle, if the circle overlaps with a large navmesh polygon.
bool ezAiNavmeshQuery::PrepareQueryArea | ( | const ezVec3 & | vCenter, |
float | fRadius | ||
) |
Checks that the given area of the navmesh is loaded, such that query results are useful.
Returns false, if some navmesh sector is not yet available. It will be put into a queue and generated over the next frames.
bool ezAiNavmeshQuery::Raycast | ( | const ezVec3 & | vStart, |
const ezVec3 & | vDir, | ||
float | fDistance, | ||
ezAiNavmeshRaycastHit & | out_raycastHit | ||
) |
Does a raycast along the navmesh from the start position into a given direction.
Returns true, if a navmesh edge has been hit and the result struct was filled with details.
void ezAiNavmeshQuery::SetNavmesh | ( | ezAiNavMesh * | pNavmesh | ) |
Sets on which navmesh to do the queries.
void ezAiNavmeshQuery::SetQueryFilter | ( | const dtQueryFilter & | filter | ) |
Sets the filter to use on the navmesh to ignore certain areas.