Function BBTree.QueryClosest
Queries the tree for the closest node to p constrained by the NNConstraint trying to improve an existing solution.
void QueryClosest (
float3 | p | Point to search around |
constraint | Optionally set to constrain which nodes to return |
|
projection | Projection parameters derived from the constraint |
|
ref float | distanceSqr | The best squared distance for the previous solution. Will be updated with the best distance after this search. Supply positive infinity to start the search from scratch. |
refNNInfo | previous | This search will start from the previous NNInfo and improve it if possible. Will be updated with the new result. Even if the search fails on this call, the solution will never be worse than previous. |
nodes | The nodes what this BBTree was built from |
|
UnsafeSpan<int> | triangles | The triangles that this BBTree was built from |
vertices | The vertices that this BBTree was built from |
Queries the tree for the closest node to p constrained by the NNConstraint trying to improve an existing solution.
Note that this function will only fill in the constrained node. If you want a node not constrained by any NNConstraint, do an additional search with constraint = NNConstraint.None