📄️ Overview
Neighbor queries find k neighbors of each entity. The image below shows a SteeringSystemAsset with one group of neighbor behaviors. The selected neighbor query here is KDTreeKNNJobWrapper. It finds at most MaxNumNeighbors of neighbors which are less than MaxNeighborDistance units away. MaxFOV can be used to specify the field of view of each entity. In this case, the query only considers entities with 6_SampleBehaviorsTagComponent, here it's the same tag as the Main Tag, but generally they can be different. It is also possible to add more tags. In that case a potential neighbor must have at least one of these tags.
📄️ INeighborQueryJobWrapper
Neighbor queries are implementations of INeighborQueryJobWrapper. Given two sets of entities, they find MaxNumNeighbors neighbors for each entity from the first set. Normally this is MaxNumNeighbors nearest entities restricted by field of view FOV, but generally other criteria of a neighborhood could be implemented. The resulting neighborhood is passed into neighbor behaviors.
📄️ NeighborQueryParams
NeighborQueryParams is passed into all implementations of INeighborQueryJobWrapper. It has NeighborhoodSettings containing properties like MaxNumNeighbors set up in the editor. There are also BaseBehaviorParams for the main entities (based on Main Tag), and BaseBehaviorParams for the potential neighbors (based on the tags specified in the neighbor query).