Closed ebf34e12952930cf closed 7 years ago
It also doesnt make too much sense to break the distanceTo function into 2 different functions, unless you see there being a need to call them separately? And i dont follow the reason for the change in this line:
if (loc.sqDistanceTo(target) > step * step)
From the definition of the sqDistanceTo function, i cant see step * step ever being greater then sqDistanceTo (especially since step is like .6-.8 for new players). Why not just change it to:
if (loc.distanceTo(target) > step)
?
the double
s are just because prod does that, but i can change it to float
s if that's preferred here. the distanceTo
is just if you're not using squared values. i changed it to squared values because if i remember correctly, its faster to not use sqrt
and instead do squared values, but i may be wrong.
Eh whatever works for the sqrt thing i guess. But yes i would prefer to keep the values as floats instead of converting it over to a double and then back to a float to send.
Why are you returning atan2 as a double? Or wait, why are you returning all of the helper functions in WorldPosData as doubles? I dont follow why that would be better then returning it as a float, which all of the math functions used do support.