Skip to main content
Participant
July 14, 2014
Question

Is Point.interpolate deterministic?

  • July 14, 2014
  • 1 reply
  • 264 views

Hi,

I am currently developing a truly deterministic ballistic engine, and so far I am doing good, I avoid numbers/floats and Math.cos/sin. But now I would like to interpolate between my points, and it would be easy for me to use the Point.interpolate method. Is this method truly cross platform/CPU deterministic?

My points contain integers, I don´t mind getting float/number results, as long as they are deterministic.

Thanks, Brian

This topic has been closed for replies.

1 reply

Inspiring
July 14, 2014

Well Point.interpolate is going to be performing floating point math, so it'll be as deterministic as that. I'm not familiar enough with the imprecision issues of floating point math but I would think that if you start with integers, you'll always get a result that would round to the same resulting integer... but again I'm not sure.

Point.interpoloate is just the same as:

p = p1 + (p2 - p1) * n;

-Aaron