# HG changeset patch # User yoctozepto # Date 1378452557 -7200 # Node ID 270627b54ed42c852928838a321290f3f44da11f # Parent f0551cd4cbc9d21568683ad2dda32b33decf1d3e Fix Vec3::Normalize_float(). diff -r f0551cd4cbc9 -r 270627b54ed4 VectorTypes.cpp --- a/VectorTypes.cpp Fri Sep 06 09:29:12 2013 +0200 +++ b/VectorTypes.cpp Fri Sep 06 09:29:17 2013 +0200 @@ -1,6 +1,7 @@ #include #include "mm7_data.h" +#include "Math.h" //----- (004621DA) -------------------------------------------------------- uint32_t int_get_vector_length(int32_t x, int32_t y, int32_t z) @@ -25,14 +26,14 @@ template void Vec3::Normalize_float() { - long double x = this->x; - long double y = this->y; - long double z = this->z; - long double s = sqrtl(x * x + y * y + z * z); + double x = this->x; + double y = this->y; + double z = this->z; + double s = sqrt(x * x + y * y + z * z); - this->x = (T)(x / s); - this->y = (T)(y / s); - this->z = (T)(z / s); + this->x = bankersRounding(x / s); + this->y = bankersRounding(y / s); + this->z = bankersRounding(z / s); } //----- (0043AA99) --------------------------------------------------------