How to calculate an interpolated velocity on RVOController

Hi Aron,

I want to control the movement of an RVO agent in my own controller instead of RVOController-> Update(). below is my code for retrieving correct interpolated velocity from RVOController:

`
public Vector3 GetInterpolatedVelocity(Vector3 desiredVelocity)
{
UpdateAgentProperties ();
List obst = rvoAgent.NeighbourObstacles;
Vector3 force = Vector3.zero;

for (int i=0;i<obst.Count;i++) {
    Vector3 a = obst[i].position;
    Vector3 b = obst[i].next.position;
	
    Vector3 closest = position - Mathfx.NearestPointStrict (a,b,position);
	
    if (closest == a || closest == b) continue;
	
    float dist = closest.sqrMagnitude;
    closest /= dist*falloff;
    force += closest;
}

rvoAgent.DesiredVelocity = desiredVelocity + force*wallAvoidForce; 
return rvoAgent.InterpolatedPosition;

}
`

After testing above result, the agent movement looks weird, is there anything missed?

Thanks,

Ed

Um…
I am not sure exactly what you are doing there.
The function is called GetInterpolatedVelocity, yet you return InterpolatedPosition?
Could you explain a bit more on exactly what you want to do?