Atoms Crowd  4.1.0
AtomsUtils::dtQueryFilter Class Reference

#include <DetourNavMeshQuery.h>

Public Member Functions

 dtQueryFilter (bool inIsVirtual=true)
 
bool passFilter (const dtPolyRef ref, const dtMeshTile *tile, const dtPoly *poly) const
 
float 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) const
 
bool equals (const dtQueryFilter *other) const
 Check if two filters have the same data values.
 
bool equals (const dtQueryFilter &other) const
 
void copyFrom (const dtQueryFilter *other)
 Copy data values from source filter.
 
void copyFrom (const dtQueryFilter &other)
 
Getters and setters for the default implementation data.
float getAreaCost (const int i) const
 
void setAreaCost (const int i, const float cost)
 
const float * getAllAreaCosts () const
 
float getAreaFixedCost (const int i) const
 
void setAreaFixedCost (const int i, const float cost)
 
const float * getAllFixedAreaCosts () const
 
float getModifiedHeuristicScale () const
 
float getHeuristicScale () const
 
void setHeuristicScale (const float newScale)
 Set euclidean distance heuristic scale.
 
bool isValidLinkSide (const unsigned char side) const
 
void setIsBacktracking (const bool isBacktracking)
 Sets up filter for backtracking.
 
bool getIsBacktracking () const
 
void setShouldIgnoreClosedNodes (const bool shouldIgnore)
 Instruct filter whether it can reopen nodes already on closed list.
 
bool getShouldIgnoreClosedNodes () const
 
unsigned short getIncludeFlags () const
 
void setIncludeFlags (const unsigned short flags)
 
unsigned short getExcludeFlags () const
 
void setExcludeFlags (const unsigned short flags)
 

Protected Member Functions

bool passInlineFilter (const dtPolyRef ref, const dtMeshTile *tile, const dtPoly *poly) const
 inlined filter implementation. More...
 
virtual bool passVirtualFilter (const dtPolyRef ref, const dtMeshTile *tile, const dtPoly *poly) const
 virtual filter implementation (defaults to passInlineFilter). More...
 
float getInlineCost (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) const
 inlined scoring function. More...
 
virtual float getVirtualCost (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) const
 virtual scoring function implementation (defaults to getInlineCost). More...
 

Protected Attributes

dtQueryFilterData data
 
const bool isVirtual
 

Detailed Description

Defines polygon filtering and traversal costs for navigation mesh query operations.

Member Function Documentation

◆ getAreaCost()

float AtomsUtils::dtQueryFilter::getAreaCost ( const int  i) const
inline

Returns the traversal cost of the area.

Parameters
[in]iThe id of the area.
Returns
The traversal cost of the area.

◆ getAreaFixedCost()

float AtomsUtils::dtQueryFilter::getAreaFixedCost ( const int  i) const
inline

Returns the fixed cost for entering an area.

Parameters
[in]iThe id of the area.
Returns
The fixed cost of the area.

◆ getCost()

float AtomsUtils::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 
) const
inline

Returns cost to move from the beginning to the end of a line segment that is fully contained within a polygon.

Parameters
[in]paThe start position on the edge of the previous and current polygon. [(x, y, z)]
[in]pbThe end position on the edge of the current and next polygon. [(x, y, z)]
[in]prevRefThe reference id of the previous polygon. [opt]
[in]prevTileThe tile containing the previous polygon. [opt]
[in]prevPolyThe previous polygon. [opt]
[in]curRefThe reference id of the current polygon.
[in]curTileThe tile containing the current polygon.
[in]curPolyThe current polygon.
[in]nextRefThe reference id of the next polygon. [opt]
[in]nextTileThe tile containing the next polygon. [opt]
[in]nextPolyThe next polygon. [opt]

◆ getExcludeFlags()

unsigned short AtomsUtils::dtQueryFilter::getExcludeFlags ( ) const
inline

Returns the exclude flags for the filter. Any polygons that include one ore more of these flags will be excluded from the operation.

◆ getHeuristicScale()

float AtomsUtils::dtQueryFilter::getHeuristicScale ( ) const
inline

Retrieves euclidean distance heuristic scale

Returns
heuristic scale

◆ getIncludeFlags()

unsigned short AtomsUtils::dtQueryFilter::getIncludeFlags ( ) const
inline

Returns the include flags for the filter. Any polygons that include one or more of these flags will be included in the operation.

◆ getInlineCost()

float AtomsUtils::dtQueryFilter::getInlineCost ( 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 
) const
inlineprotected

inlined scoring function.

See also
getCost for parameter description

◆ getIsBacktracking()

bool AtomsUtils::dtQueryFilter::getIsBacktracking ( ) const
inline

Retrieves information whether this filter is set up for backtracking

Returns
is backtracking

◆ getShouldIgnoreClosedNodes()

bool AtomsUtils::dtQueryFilter::getShouldIgnoreClosedNodes ( ) const
inline

Retrieves information whether this filter allows reopening closed nodes

Returns
should consider reopening nodes already on closed list

◆ getVirtualCost()

virtual float AtomsUtils::dtQueryFilter::getVirtualCost ( 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 
) const
inlineprotectedvirtual

virtual scoring function implementation (defaults to getInlineCost).

See also
getCost for parameter description

◆ isValidLinkSide()

bool AtomsUtils::dtQueryFilter::isValidLinkSide ( const unsigned char  side) const
inline

Filters link in regards to its side. Used for backtracking.

Returns
should link with this side be accepted

◆ passFilter()

bool AtomsUtils::dtQueryFilter::passFilter ( const dtPolyRef  ref,
const dtMeshTile tile,
const dtPoly poly 
) const
inline

Returns true if the polygon can be visited. (I.e. Is traversable.)

Parameters
[in]refThe reference id of the polygon test.
[in]tileThe tile containing the polygon.
[in]polyThe polygon to test.

◆ passInlineFilter()

bool AtomsUtils::dtQueryFilter::passInlineFilter ( const dtPolyRef  ref,
const dtMeshTile tile,
const dtPoly poly 
) const
inlineprotected

inlined filter implementation.

See also
passFilter for parameter description

◆ passVirtualFilter()

virtual bool AtomsUtils::dtQueryFilter::passVirtualFilter ( const dtPolyRef  ref,
const dtMeshTile tile,
const dtPoly poly 
) const
inlineprotectedvirtual

virtual filter implementation (defaults to passInlineFilter).

See also
passFilter for parameter description

◆ setAreaCost()

void AtomsUtils::dtQueryFilter::setAreaCost ( const int  i,
const float  cost 
)
inline

Sets the traversal cost of the area.

Parameters
[in]iThe id of the area.
[in]costThe new cost of traversing the area.

◆ setAreaFixedCost()

void AtomsUtils::dtQueryFilter::setAreaFixedCost ( const int  i,
const float  cost 
)
inline

Sets the fixed cost for entering an area.

Parameters
[in]iThe id of the area.
[in]costThe new fixed cost of entering the area polygon.

◆ setExcludeFlags()

void AtomsUtils::dtQueryFilter::setExcludeFlags ( const unsigned short  flags)
inline

Sets the exclude flags for the filter.

Parameters
[in]flagsThe new flags.

◆ setIncludeFlags()

void AtomsUtils::dtQueryFilter::setIncludeFlags ( const unsigned short  flags)
inline

Sets the include flags for the filter.

Parameters
[in]flagsThe new flags.

The documentation for this class was generated from the following file: