From c5fd5bc4cdce862ce5a9f2663e1e1fc50e303b9d Mon Sep 17 00:00:00 2001 From: cutealien Date: Thu, 10 Mar 2022 12:24:03 +0000 Subject: [PATCH] Avoid warnings when working with CMatrix4 git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6303 dfc29bdd-3216-0410-991c-e03cc46cb475 --- include/matrix4.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/include/matrix4.h b/include/matrix4.h index 90d13ad..2b6fd49 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