Navigation
API > API/Runtime > API/Runtime/Navmesh
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.
| Name | dtQueryFilter |
| Type | class |
| Header File | /Engine/Source/Runtime/Navmesh/Public/Detour/DetourNavMeshQuery.h |
| Include Path | #include "Detour/DetourNavMeshQuery.h" |
Syntax
class dtQueryFilter
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
dtQueryFilter
(
bool inIsVirtual |
Detour/DetourNavMeshQuery.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual ~dtQueryFilter() |
Detour/DetourNavMeshQuery.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void copyFrom
(
const dtQueryFilter& other |
Detour/DetourNavMeshQuery.h | ||
void copyFrom
(
const dtQueryFilter* other |
Copy data values from source filter. | Detour/DetourNavMeshQuery.h | |
bool equals
(
const dtQueryFilter& other |
Detour/DetourNavMeshQuery.h | ||
bool equals
(
const dtQueryFilter* other |
Check if two filters have the same data values. | Detour/DetourNavMeshQuery.h | |
const dtReal * getAllAreaCosts() |
Detour/DetourNavMeshQuery.h | ||
const dtReal * getAllFixedAreaCosts() |
Detour/DetourNavMeshQuery.h | ||
dtReal getAreaCost
(
const int i |
Returns the traversal cost of the area. | Detour/DetourNavMeshQuery.h | |
dtReal getAreaFixedCost
(
const int i |
Returns the fixed cost for entering an area. | Detour/DetourNavMeshQuery.h | |
dtReal getCost
(
const dtReal* pa, |
Returns cost to move from the beginning to the end of a line segment that is fully contained within a polygon. | Detour/DetourNavMeshQuery.h | |
unsigned short getExcludeFlags () |
Returns the exclude flags for the filter. | Detour/DetourNavMeshQuery.h | |
dtReal getHeuristicScale() |
Retrieves euclidean distance heuristic scale | Detour/DetourNavMeshQuery.h | |
unsigned short getIncludeFlags () |
Returns the include flags for the filter. | Detour/DetourNavMeshQuery.h | |
bool getIsBacktracking() |
Retrieves information whether this filter is set up for backtracking | Detour/DetourNavMeshQuery.h | |
bool getIsVirtual() |
Returns true if it's a virtual filter. | Detour/DetourNavMeshQuery.h | |
dtReal getModifiedHeuristicScale() |
Detour/DetourNavMeshQuery.h | ||
bool getShouldIgnoreClosedNodes() |
Retrieves information whether this filter allows reopening closed nodes | Detour/DetourNavMeshQuery.h | |
bool isValidLinkSide
(
const unsigned char side |
Filters link in regards to its side. Used for backtracking. | Detour/DetourNavMeshQuery.h | |
bool passFilter
(
const dtPolyRef ref, |
Returns true if the polygon can be visited. (I.e. Is traversable.) | Detour/DetourNavMeshQuery.h | |
void setAreaCost
(
const int i, |
Sets the traversal cost of the area. | Detour/DetourNavMeshQuery.h | |
void setAreaFixedCost
(
const int i, |
Sets the fixed cost for entering an area. | Detour/DetourNavMeshQuery.h | |
void setExcludeFlags
(
const unsigned short flags |
Sets the exclude flags for the filter. | Detour/DetourNavMeshQuery.h | |
void setHeuristicScale
(
const dtReal newScale |
Set euclidean distance heuristic scale. | Detour/DetourNavMeshQuery.h | |
void setIncludeFlags
(
const unsigned short flags |
Sets the include flags for the filter. | Detour/DetourNavMeshQuery.h | |
void setIsBacktracking
(
const bool isBacktracking |
Sets up filter for backtracking. | Detour/DetourNavMeshQuery.h | |
void setShouldIgnoreClosedNodes
(
const bool shouldIgnore |
Instruct filter whether it can reopen nodes already on closed list. | Detour/DetourNavMeshQuery.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
dtReal getInlineCost
(
const dtReal* pa, |
Inlined scoring function. | Detour/DetourNavMeshQuery.h | |
virtual float getVirtualCost
(
const float* pa, |
This function is deprecated call the version on this function that takes FReal. | Detour/DetourNavMeshQuery.h | |
virtual dtReal getVirtualCost
(
const dtReal* pa, |
Virtual scoring function implementation (defaults to getInlineCost). | Detour/DetourNavMeshQuery.h | |
bool passInlineFilter
(
const dtPolyRef ref, |
Inlined filter implementation. | Detour/DetourNavMeshQuery.h | |
virtual bool passVirtualFilter
(
const dtPolyRef ref, |
Virtual filter implementation (defaults to passInlineFilter). | Detour/DetourNavMeshQuery.h |