[Teleus-cvs] teleus/src/math vector.cpp,1.15,1.16 vector.hpp,1.12,1.13
Status: Inactive
Brought to you by:
spiffgq
|
From: <sp...@us...> - 2004-03-11 03:33:09
|
Update of /cvsroot/teleus/teleus/src/math In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8511/src/math Modified Files: vector.cpp vector.hpp Log Message: Modified Vector4d::multAndSet() to use the named variables instead of the array. I don't know why I used an array in the first place, but it was a potential bug waiting to happen. Index: vector.cpp =================================================================== RCS file: /cvsroot/teleus/teleus/src/math/vector.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** vector.cpp 25 Feb 2004 06:34:00 -0000 1.15 --- vector.cpp 11 Mar 2004 03:14:43 -0000 1.16 *************** *** 941,949 **** void Vector4d::normalize (){ ! double l = this->length(); ! this->w = this->w / l; ! this->x = this->x / l; ! this->y = this->y / l; ! this->z = this->z / l; } --- 941,949 ---- void Vector4d::normalize (){ ! double l = length(); ! w /= l; ! x /= l; ! y /= l; ! z /= l; } *************** *** 1051,1054 **** --- 1051,1075 ---- { + w = v2.w * v1.w - + v2.x * v1.x - + v2.y * v1.y - + v2.z * v1.z; + + x = v2.w * v1.x + + v2.x * v1.w + + v2.y * v1.z - + v2.z * v1.y; + + y = v2.w * v1.y - + v2.x * v1.z + + v2.y * v1.w + + v2.z * v1.x; + + z = v2.w * v1.z + + v2.x * v1.y - + v2.y * v1.x + + v2.z * v1.w; + + #if 0 w = v2.v[0] * v1.v[0] - v2.v[1] * v1.v[1] - *************** *** 1070,1073 **** --- 1091,1095 ---- v2.v[2] * v1.v[1] + v2.v[3] * v1.v[0]; + #endif } *************** *** 1261,1266 **** * \li \f$ \vec{t} \f$ is the resultant quaternion (\c this quaternion after this method is completed). * \li \f$ \vec{q} \f$ is the original quaternion (\c this quaternion before this method). ! * \li \f$ \overline{\vec{q}} \f$ is the conjugate of \$f \vec{q} \f$. ! * \li \f$ |\vec{q}| \f$ is the magnitude of the quaternion \$f \vec{q} \f$. * * \author Daniel Royer --- 1283,1288 ---- * \li \f$ \vec{t} \f$ is the resultant quaternion (\c this quaternion after this method is completed). * \li \f$ \vec{q} \f$ is the original quaternion (\c this quaternion before this method). ! * \li \f$ \overline{\vec{q}} \f$ is the conjugate of \f$ \vec{q} \f$. ! * \li \f$ |\vec{q}| \f$ is the magnitude of the quaternion \f$ \vec{q} \f$. * * \author Daniel Royer Index: vector.hpp =================================================================== RCS file: /cvsroot/teleus/teleus/src/math/vector.hpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** vector.hpp 25 Feb 2004 02:23:26 -0000 1.12 --- vector.hpp 11 Mar 2004 03:14:44 -0000 1.13 *************** *** 139,143 **** double v[4]; struct { - // If you modifiy this order, change multiplyAndSet, too. double w, x, y, z; }; --- 139,142 ---- |