A* Pathfinding Project
3.7.4
The A* Pathfinding Project for Unity 3D
|
Nearest node constraint. More...
Nearest node constraint.
Constrains which nodes will be returned by the GetNearest function
Public Member Functions | |
NNConstraint () | |
Default constructor. | |
virtual bool | Suitable (GraphNode node) |
Returns whether or not the node conforms to this NNConstraint's rules. | |
virtual bool | SuitableGraph (int graphIndex, NavGraph graph) |
Returns whether or not the graph conforms to this NNConstraint's rules. | |
Public Attributes | |
int | area = -1 |
Area ID to constrain to. | |
bool | constrainArea |
Only treat nodes in the area area as suitable. | |
bool | constrainDistance = true |
Constrain distance to node. | |
bool | constrainTags = true |
Sets if tags should be constrained. | |
bool | constrainWalkability = true |
Only treat nodes with the walkable flag set to the same as walkable as suitable. | |
bool | distanceXZ |
if available, do an XZ check instead of checking on all axes. | |
int | graphMask = -1 |
Graphs treated as valid to search on. | |
int | tags = -1 |
Nodes which have any of these tags set are suitable. | |
bool | walkable = true |
What must the walkable flag on a node be for it to be suitable. | |
Properties | |
static NNConstraint | Default [get] |
The default NNConstraint. | |
static NNConstraint | None [get] |
Returns a constraint which will not filter the results. | |
NNConstraint | ( | ) |
Default constructor.
Equals to the property Default
|
virtual |
Returns whether or not the node conforms to this NNConstraint's rules.
Reimplemented in FloodPathConstraint.
|
virtual |
Returns whether or not the graph conforms to this NNConstraint's rules.
Note that only the first 31 graphs are considered using this function. If the graphMask has bit 31 set (i.e the last graph possible to fit in the mask), all graphs above index 31 will also be considered suitable.
int area = -1 |
Area ID to constrain to.
Will not affect anything if less than 0 (zero) or if constrainArea is false
bool constrainArea |
bool constrainDistance = true |
Constrain distance to node.
Uses distance from AstarPath.maxNearestNodeDistance. If this is false, it will completely ignore the distance limit.
bool constrainTags = true |
Sets if tags should be constrained.
bool constrainWalkability = true |
Only treat nodes with the walkable flag set to the same as walkable as suitable.
bool distanceXZ |
if available, do an XZ check instead of checking on all axes.
The RecastGraph supports this
int graphMask = -1 |
Graphs treated as valid to search on.
This is a bitmask meaning that bit 0 specifies whether or not the first graph in the graphs list should be able to be included in the search, bit 1 specifies whether or not the second graph should be included and so on.
int tags = -1 |
Nodes which have any of these tags set are suitable.
This is a bitmask, i.e bit 0 indicates that tag 0 is good, bit 3 indicates tag 3 is good etc.
bool walkable = true |
What must the walkable flag on a node be for it to be suitable.
Does not affect anything if constrainWalkability if false
|
staticget |
The default NNConstraint.
Equivalent to new NNConstraint (). This NNConstraint has settings which works for most, it only finds walkable nodes and it constrains distance set by A* Inspector -> Settings -> Max Nearest Node Distance
|
staticget |
Returns a constraint which will not filter the results.