Navigation
Unreal Engine C++ API Reference > Runtime > Navmesh > Detour
References
Module | Navmesh |
Header | /Engine/Source/Runtime/Navmesh/Public/Detour/DetourNavMeshQuery.h |
Include | #include "Detour/DetourNavMeshQuery.h" |
Syntax
class dtQueryFilter
Remarks
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.
Variables
Type | Name | Description | |
---|---|---|---|
![]() |
dtQueryFilterData | data | |
![]() |
bool | isVirtual |
Constructors
Type | Name | Description | |
---|---|---|---|
![]() |
dtQueryFilter
(
bool inIsVirtual |
Destructors
Type | Name | Description | |
---|---|---|---|
![]() ![]() |
Functions
Type | Name | Description | |
---|---|---|---|
![]() |
void | copyFrom
(
const dtQueryFilter& other |
|
![]() |
void | copyFrom
(
const dtQueryFilter* other |
Copy data values from source filter. |
![]() ![]() |
bool | equals
(
const dtQueryFilter& other |
|
![]() ![]() |
bool | equals
(
const dtQueryFilter* other |
Check if two filters have the same data values. |
![]() ![]() |
const dtReal * | ||
![]() ![]() |
const dtReal * | ||
![]() ![]() |
dtReal | getAreaCost
(
const int i |
Returns the traversal cost of the area. |
![]() ![]() |
dtReal | getAreaFixedCost
(
const int i |
Returns the fixed cost for entering an area. |
![]() ![]() |
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. |
![]() ![]() |
unsigned short | Returns the exclude flags for the filter. | |
![]() ![]() |
dtReal | Retrieves euclidean distance heuristic scale | |
![]() ![]() |
unsigned short | Returns the include flags for the filter. | |
![]() ![]() |
dtReal | getInlineCost
(
const dtReal* pa, |
Inlined scoring function. |
![]() ![]() |
bool | Retrieves information whether this filter is set up for backtracking | |
![]() ![]() |
dtReal | ||
![]() ![]() |
bool | Retrieves information whether this filter allows reopening closed nodes | |
![]() ![]() ![]() |
float | getVirtualCost
(
const float* pa, |
This function is deprecated call the version on this function that takes FReal. |
![]() ![]() ![]() |
dtReal | getVirtualCost
(
const dtReal* pa, |
Virtual scoring function implementation (defaults to getInlineCost). |
![]() ![]() |
bool | isValidLinkSide
(
const unsigned char side |
Filters link in regards to its side. Used for backtracking. |
![]() ![]() |
bool | passFilter
(
const dtPolyRef ref, |
Returns true if the polygon can be visited. (I.e. Is traversable.) |
![]() ![]() |
bool | passInlineFilter
(
const dtPolyRef ref, |
Inlined filter implementation. |
![]() ![]() ![]() |
bool | passVirtualFilter
(
const dtPolyRef ref, |
Virtual filter implementation (defaults to passInlineFilter). |
![]() |
void | setAreaCost
(
const int i, |
Sets the traversal cost of the area. |
![]() |
void | setAreaFixedCost
(
const int i, |
Sets the fixed cost for entering an area. |
![]() |
void | setExcludeFlags
(
const unsigned short flags |
Sets the exclude flags for the filter. |
![]() |
void | setHeuristicScale
(
const dtReal newScale |
Set euclidean distance heuristic scale. |
![]() |
void | setIncludeFlags
(
const unsigned short flags |
Sets the include flags for the filter. |
![]() |
void | setIsBacktracking
(
const bool isBacktracking |
Sets up filter for backtracking. |
![]() |
void | setShouldIgnoreClosedNodes
(
const bool shouldIgnore |
Instruct filter whether it can reopen nodes already on closed list. |