diff --git a/inc/hgl/math/Vector.h b/inc/hgl/math/Vector.h index d2557cc..baabe30 100644 --- a/inc/hgl/math/Vector.h +++ b/inc/hgl/math/Vector.h @@ -185,6 +185,7 @@ namespace hgl { return sqrt(length_squared(v1-v2)); } + template inline float length_squared(const T1 &v1, const T2 &v2) { @@ -194,8 +195,8 @@ namespace hgl template inline float length_squared_2d(const T1 &v1, const T2 &v2) { - const float x = (v1.x - v2.x); - const float y = (v1.y - v2.y); + const double x = double(v1.x) - double(v2.x); + const double y = double(v1.y) - double(v2.y); return x*x + y*y; }