I would like to use local avoidance for rock and tree instances. If I create a lightweight RVOObstacle class that doesn’t inherit from a Monobehavior can the RVOSimulator handle this? Basically, I have a list of rock and tree instances that are not game objects and I’d like to add these as obstacles to the RVOSimultor using the position in the world and the verts I pass to the simulator. Thanks.
Sure it can.
Check how the RVOObstacle is implemented, it just adds the vertices to the simulator.
Just make sure you keep track of the orientation (winding order) of your obstacles as they need to be wound correctly (there is a method for this in the RVOObstacle).
Cool, that worked great! Thanks! Quick question. These are all static obstacles. They will never move but there are MANY of them. My question is, once I do throw in some dynamic obstacles using the regular RVOObstacle monobehavior class, how expensive is rebuilding the quad tree?
Does it say something in the documentation about a quadtree?
The obstacles are not stored in a quadtree at the moment, agents are however (which is rebuilt every tick, so that’s fast).
So unfortunately it will scale roughly linearly with the number of obstacles.
This is something I should probably improve in the future.
I see. I just assumed that obstacles were handled in a similar way to the agents when added to the rvo simulation. We have potentially thousands of trees in or world being treated as obstacles. Would it be difficult to get these stored in a quadtree?