A* Pathfinding Project  3.0.9
The A* Pathfinding Project for Unity
NNConstraint Class Reference

Nearest node constraint. More...

+ Inheritance diagram for NNConstraint:

List of all members.

Public Member Functions

virtual bool SuitableGraph (int graphIndex, NavGraph graph)  Returns whether or not the graph conforms to this NNConstraint's rules.
virtual bool Suitable (Node node)  Returns whether or not the node conforms to this NNConstraint's rules.
 NNConstraint ()  Default constructor.

Public Variables

int graphMask = -1  Graphs treated as valid to search on.
bool constrainArea = false  Only treat nodes in the area area as suitable.
int area = -1  Area ID to constrain to.
bool constrainWalkability = true  Only treat nodes with the walkable flag set to the same as walkable as 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.

Detailed Description

Nearest node constraint.

Constrains which nodes will be returned by the GetNearest function


Constructor & Destructor Documentation

Default constructor.

Equals to the property Default


Member Function Documentation

virtual bool Suitable ( Node  node) [virtual]

Returns whether or not the node conforms to this NNConstraint's rules.

Reimplemented in PathIDConstraint.

virtual bool SuitableGraph ( int  graphIndex,
NavGraph  graph 
) [virtual]

Returns whether or not the graph conforms to this NNConstraint's rules.

A* Pro Feature:
This is an A* Pathfinding Project Pro feature only. This function/class/variable might not exist in the Free version of the A* Pathfinding Project or the functionality might be limited
The Pro version can be bought here

Member Data Documentation

int area = -1

Area ID to constrain to.

Will not affect anything if less than 0 (zero) or if constrainArea is false

bool constrainArea = false

Only treat nodes in the area area as suitable.

Does not affect anything if area is less than 0 (zero)

bool constrainWalkability = true

Only treat nodes with the walkable flag set to the same as walkable as suitable.

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.

 //Enables the first and third graphs to be included, but not the rest
 myNNConstraint.graphMask = (1 << 0) | (1 << 2);
Note:
This does only affect which nodes are returned from a GetNearest call, if an invalid graph is linked to from a valid graph, it might be searched anyway.
A* Pro Feature:
This is an A* Pathfinding Project Pro feature only. This function/class/variable might not exist in the Free version of the A* Pathfinding Project or the functionality might be limited
The Pro version can be bought here
See also:
AstarPath::GetNearest
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


Property Documentation

NNConstraint Default [static, get]

The default NNConstraint.

Reimplemented in PathNNConstraint.

NNConstraint None [static, get]

Returns a constraint which will not filter the results.


The documentation for this class was generated from the following file:
 All Classes Functions Variables Enumerations Properties