"Moving" Example, Rotation and RVO


#1

Heya! So I’ve been using this plugin for a few months and have been very pleased with what I’ve gotten. Now I think I’ve started to venture into the hairy edges of things, though. I’ve run into a strange behaviour when trying to apply the things from the “Example13_Moving” example project into a scene.

Adding in RVO controllers on their own seems to be fine, but if there are both RVO controllers, and the object with the LocalSpaceGraph component rotates on either horizonal axis, then a problem arises. If the LocalSpaceGraph pitches or rolls too steeply, then the seeking objects seem to slide away from their targets (either ‘uphill’ or ‘downhill’, so long as it’s away). Removing the RVO controller seems to remove the issue, but I’d rather that avoidance remain.

Is there a way to modify the RVO, either in code or in configuration, such that this ‘sliding’ behaviour doesn’t happen?

Cheers!


#2

Hi

RVO does not work so well on a moving platform because it will think every agent is moving at a high speed some weird direction. To make it work you will have to modify the RVOController.cs script to use the transform from the LocalSpaceGraph script. Essentially every Vector3 that is read from the rvoAgent field should be transformed, and every Vector3 that is written to the rvoAgent field should be transformed using the inverse transform.

I think you might get away with only modifying the To2D and To3D methods. The To3D method should apply the graph-to-world-space transformation and the To2D method should apply the inverse transformation.