Support Forum

RVO Possible NaN

Hi!

So in RVOAgentBurst.cs in ExecuteORCA there is relativePosition. And if it’s zero then futher calculation will produce NaN’s.

I’ve fixed by simply checking for zero sqrmagnitude and setting tiny delta.

Hope it helps, thanks!

Hi

Thank you for the bug report.
I can’t quite figure out where NaNs would be generated though. From what I can see all divisions by relativePosition are checked. Where did you add your fix?

relativePositionSqrMagn can be 0 if otherPosition and position is the same.

Solved like this:

if(relativePositionSqrMagn == 0)
{
relativePosition.x = numLines % 2 == 0 ? 0.01f : -0.01f;
}