diff options
Diffstat (limited to 'source/blender/blenlib/BLI_math_vector.hh')
-rw-r--r-- | source/blender/blenlib/BLI_math_vector.hh | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/blenlib/BLI_math_vector.hh b/source/blender/blenlib/BLI_math_vector.hh index 384c4b49070..e8303aa858b 100644 --- a/source/blender/blenlib/BLI_math_vector.hh +++ b/source/blender/blenlib/BLI_math_vector.hh @@ -357,16 +357,16 @@ inline vec_base<T, 3> cross(const vec_base<T, 3> &a, const vec_base<T, 3> &b) inline vec_base<float, 3> cross_high_precision(const vec_base<float, 3> &a, const vec_base<float, 3> &b) { - return {(float)((double)a.y * b.z - (double)a.z * b.y), - (float)((double)a.z * b.x - (double)a.x * b.z), - (float)((double)a.x * b.y - (double)a.y * b.x)}; + return {float(double(a.y) * double(b.z) - double(a.z) * double(b.y)), + float(double(a.z) * double(b.x) - double(a.x) * double(b.z)), + float(double(a.x) * double(b.y) - double(a.y) * double(b.x))}; } template<typename T, BLI_ENABLE_IF((is_math_float_type<T>))> inline vec_base<T, 3> cross_poly(Span<vec_base<T, 3>> poly) { /* Newell's Method. */ - int nv = static_cast<int>(poly.size()); + int nv = int(poly.size()); if (nv < 3) { return vec_base<T, 3>(0, 0, 0); } |