diff --git a/include/matrix4.h b/include/matrix4.h index 90d13ada..2b6fd49f 100644 --- a/include/matrix4.h +++ b/include/matrix4.h @@ -1155,10 +1155,10 @@ namespace core template inline void CMatrix4::rotateVect( vector3df& vect ) const { - vector3df tmp = vect; - vect.X = tmp.X*M[0] + tmp.Y*M[4] + tmp.Z*M[8]; - vect.Y = tmp.X*M[1] + tmp.Y*M[5] + tmp.Z*M[9]; - vect.Z = tmp.X*M[2] + tmp.Y*M[6] + tmp.Z*M[10]; + vector3d tmp(static_cast(vect.X), static_cast(vect.Y), static_cast(vect.Z)); + vect.X = static_cast(tmp.X*M[0] + tmp.Y*M[4] + tmp.Z*M[8]); + vect.Y = static_cast(tmp.X*M[1] + tmp.Y*M[5] + tmp.Z*M[9]); + vect.Z = static_cast(tmp.X*M[2] + tmp.Y*M[6] + tmp.Z*M[10]); } //! An alternate transform vector method, writing into a second vector @@ -1182,10 +1182,10 @@ namespace core template inline void CMatrix4::inverseRotateVect( vector3df& vect ) const { - vector3df tmp = vect; - vect.X = tmp.X*M[0] + tmp.Y*M[1] + tmp.Z*M[2]; - vect.Y = tmp.X*M[4] + tmp.Y*M[5] + tmp.Z*M[6]; - vect.Z = tmp.X*M[8] + tmp.Y*M[9] + tmp.Z*M[10]; + vector3d tmp(static_cast(vect.X), static_cast(vect.Y), static_cast(vect.Z)); + vect.X = static_cast(tmp.X*M[0] + tmp.Y*M[1] + tmp.Z*M[2]); + vect.Y = static_cast(tmp.X*M[4] + tmp.Y*M[5] + tmp.Z*M[6]); + vect.Z = static_cast(tmp.X*M[8] + tmp.Y*M[9] + tmp.Z*M[10]); } template