Function NavmeshBase.NearestNodeDistanceSqrLowerBound

NearestNodeDistanceSqrLowerBound (Vector3 position, NNConstraint constraint)

Lower bound on the squared distance from the given point to the closest node in this graph.

Public
float NearestNodeDistanceSqrLowerBound (

Vector3

position

The position to check from

NNConstraint

constraint

A constraint on which nodes are valid. This may or may not be used by the function. You may pass null if you consider all nodes valid.

)

Lower bound on the squared distance from the given point to the closest node in this graph.

This is used to speed up searching for the closest node when there is more than one graph in the scene, by checking the graphs in order of increasing estimated distance to the point.

Implementors may return 0 at all times if it is hard to come up with a good lower bound. It is more important that this function is fast than that it is accurate.