Querying the RVOSimulator quadtree directly

Hi there,

I’m hoping to use the spatial quad tree from the local avoidance simulation in my game logic, rather than duplicating the work and maintaining some other kind of data structure or using colliders+casts etc.

Is there an easy way to say, get the nearest agent to a point on the quad tree? I’ve delved into the code a bit and found the QueryKNearest method which seems like it might do what I want, but it seems to be a job that returns asynchronously (I think, I’m not super clued up on burst jobs), so I’m not sure how to handle the data it returns.

Thank you for your time! Also this is an incredible piece of software, kudos to the creators!

Hi

It is possible to query it, however, there’s no easy way to map the agent indices back to gameobjects.
I would recommend using a different approach unless you really need it. Here’s a thread that might be of interest in that case: Using RVOQuadtree to find neighbors of Agent - #2 by aron_granberg