MNM::INavMesh

Provides an access to the NavMesh data. More...

#include

Public Member Functions

virtual void GetMeshParams (NavMesh::SParams &outParams) const =0
Fills a NavMesh::SParams structure with a mesh parameters.
virtual TileID FindTileIDByTileGridCoord (const vector3_t &tileGridCoord) const =0
virtual size_t QueryTriangles (const aabb_t &queryAabbWorld, INavMeshQueryFilter *pOptionalFilter, const size_t maxTrianglesCount, TriangleID *pOutTriangles) const =0
virtual TriangleID FindClosestTriangle (const vector3_t &queryPosWorld, const TriangleID *pCandidateTriangles, const size_t candidateTrianglesCount, vector3_t *pOutClosestPosWorld, float *pOutClosestDistanceSq) const =0
virtual bool GetTileData (const TileID tileId, Tile::STileData &outTileData) const =0
virtual const AreaAnnotation * GetTriangleAnnotation (TriangleID triangleID) const =0
virtual bool CanTrianglePassFilter (const TriangleID triangleID, const INavMeshQueryFilter &filter) const =0

Detailed Description

Provides an access to the NavMesh data.

Member Function Documentation

◆ CanTrianglePassFilter()

virtual bool MNM::INavMesh::CanTrianglePassFilter ( const TriangleID triangleID,
const INavMeshQueryFilter & filter
) const
pure virtual

Returns whether the triangle can passes the NavMesh query filter

Parameters
triangleIDId of the triangle
filterQuery filter to check triangle with
Returns
Returns true if the triangle is valid and passes the provided filter

◆ FindClosestTriangle()

virtual TriangleID MNM::INavMesh::FindClosestTriangle ( const vector3_t & queryPosWorld,
const TriangleID * pCandidateTriangles,
const size_t candidateTrianglesCount,
vector3_t * pOutClosestPosWorld,
float * pOutClosestDistanceSq
) const
pure virtual

Finds a single triangle closest to the point. /see QueryTriangles() for a way to get candidate triangles.

Parameters
queryPosWorldQuery point in a world coordinate space.
pCandidateTrianglesArray of triangleID to search.
candidateTrianglesCountSize of pCandidateTriangles array.
pOutClosestPosWorldOptional pointer for a return value of a snapped to the triangle point in the world coordinate space.
pOutClosestDistanceSqOptional pointer for a return value of squared distance between query point and a snapped to the triangle point.
Returns
ID of a found closest triangle.

◆ FindTileIDByTileGridCoord()

virtual TileID MNM::INavMesh::FindTileIDByTileGridCoord ( const vector3_t & tileGridCoord) const
pure virtual

Finds a TileID by the tile's grid coordinate.

Returns
Valid TileID, if such tile exists. Otherwise, return MNM::Constants::InvalidTileID.

◆ GetTileData()

virtual bool MNM::INavMesh::GetTileData ( const TileID tileId,
Tile::STileData & outTileData
) const
pure virtual

Fills a STileData structure for a read-only tile data access

Parameters
tileIdId of tile
outTileDataSTileData structure to fill
Returns
true if tile is found and outTileData is filled.

◆ GetTriangleAnnotation()

virtual const AreaAnnotation* MNM::INavMesh::GetTriangleAnnotation ( TriangleID triangleID) const
pure virtual

Returns triangle area annotation

Parameters
triangleIDid of the triangle
Returns
Pointer to triangle area annotation or null if the triangle isn't found

◆ QueryTriangles()

virtual size_t MNM::INavMesh::QueryTriangles ( const aabb_t & queryAabbWorld,
INavMeshQueryFilter * pOptionalFilter,
const size_t maxTrianglesCount,
TriangleID * pOutTriangles
) const
pure virtual

Queries NavMesh triangles inside a bounding box.

Parameters
queryAabbWorldBounding box for the query in a world coordinate space.
pOptionalFilterPointer to the optional triangle filter. If provided, then it's called for each triangleId.
maxTrianglesCountSize of output buffer for result triangleId's.
pOutTrianglesArray buffer for result triangleId's.
Returns
Count of found triangleId's.