Fixed Visual C++ /W4 warnings

This commit is contained in:
Christophe Riccio 2017-08-22 23:58:31 +02:00
parent 6932058f59
commit b5eb654ff0

View File

@ -150,7 +150,7 @@ namespace detail
{ {
T norm_u_norm_v = sqrt(dot(u, u) * dot(v, v)); T norm_u_norm_v = sqrt(dot(u, u) * dot(v, v));
T real_part = norm_u_norm_v + dot(u, v); T real_part = norm_u_norm_v + dot(u, v);
vec<3, T, Q> w; vec<3, T, Q> t;
if(real_part < static_cast<T>(1.e-6f) * norm_u_norm_v) if(real_part < static_cast<T>(1.e-6f) * norm_u_norm_v)
{ {
@ -158,15 +158,15 @@ namespace detail
// around an arbitrary orthogonal axis. Axis normalisation // around an arbitrary orthogonal axis. Axis normalisation
// can happen later, when we normalise the quaternion. // can happen later, when we normalise the quaternion.
real_part = static_cast<T>(0); real_part = static_cast<T>(0);
w = abs(u.x) > abs(u.z) ? vec<3, T, Q>(-u.y, u.x, static_cast<T>(0)) : vec<3, T, Q>(static_cast<T>(0), -u.z, u.y); t = abs(u.x) > abs(u.z) ? vec<3, T, Q>(-u.y, u.x, static_cast<T>(0)) : vec<3, T, Q>(static_cast<T>(0), -u.z, u.y);
} }
else else
{ {
// Otherwise, build quaternion the standard way. // Otherwise, build quaternion the standard way.
w = cross(u, v); t = cross(u, v);
} }
*this = normalize(tquat<T, Q>(real_part, w.x, w.y, w.z)); *this = normalize(tquat<T, Q>(real_part, t.x, t.y, t.z));
} }
template<typename T, qualifier Q> template<typename T, qualifier Q>