|
| | dtQueryFilter (bool inIsVirtual=true) |
| |
| virtual | ~dtQueryFilter () |
| |
| bool | getIsVirtual () const |
| | Returns true if it's a virtual filter.
|
| |
| bool | passFilter (const dtPolyRef ref, const dtMeshTile *tile, const dtPoly *poly) const |
| |
| dtReal | getCost (const dtReal *pa, const dtReal *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) |
| |
|
| dtReal | getAreaCost (const int i) const |
| |
| void | setAreaCost (const int i, const dtReal cost) |
| |
| const dtReal * | getAllAreaCosts () const |
| |
| dtReal | getAreaFixedCost (const int i) const |
| |
| void | setAreaFixedCost (const int i, const dtReal cost) |
| |
| const dtReal * | getAllFixedAreaCosts () const |
| |
| dtReal | getModifiedHeuristicScale () const |
| |
| dtReal | getHeuristicScale () const |
| |
| void | setHeuristicScale (const dtReal 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) |
| |
|
| bool | passInlineFilter (const dtPolyRef ref, const dtMeshTile *tile, const dtPoly *poly) const |
| | inlined filter implementation.
|
| |
| virtual bool | passVirtualFilter (const dtPolyRef ref, const dtMeshTile *tile, const dtPoly *poly) const |
| | virtual filter implementation (defaults to passInlineFilter).
|
| |
| dtReal | getInlineCost (const dtReal *pa, const dtReal *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.
|
| |
| virtual dtReal | getVirtualCost (const dtReal *pa, const dtReal *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).
|
| |
| 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 final |
| |
Defines polygon filtering and traversal costs for navigation mesh query operations.
The Default Implementation
At construction: All area costs default to 1.0. All flags are included and none are excluded.
If a polygon has both an include and an exclude flag, it will be excluded.
The way filtering works, a navigation mesh polygon must have at least one flag set to ever be considered by a query. So a polygon with no flags will never be considered.
Setting the include flags to 0 will result in all polygons being excluded.
Custom Implementations
dtQueryFilter.isVIrtual must be true in order to extend this class.
Implement a custom query filter by overriding the virtual passFilter() and getCost() functions. If this is done, both functions should be as fast as possible. Use cached local copies of data rather than accessing your own objects where possible.
Custom implementations do not need to adhere to the flags or cost logic used by the default implementation.
In order for A* searches to work properly, the cost should be proportional to the travel distance. Implementing a cost modifier less than 1.0 is likely to lead to problems during pathfinding.
- See also
- dtNavMeshQuery