40 #ifndef _matrix4x4_cpp
41 #define _matrix4x4_cpp
43 #include "matrix4x4.h"
48 #include <OgreMatrix3.h>
49 #include <OgreMatrix4.h>
61 { this->
SetValues(XX,XY,XZ,XW,YX,YY,YZ,YW,ZX,ZY,ZZ,ZW,WX,WY,WZ,WW); }
152 this->
Matrix[0][0] = temp[0][0]; this->
Matrix[0][1] = temp[0][1]; this->
Matrix[0][2] = temp[0][2]; this->
Matrix[0][3] = temp[0][3];
153 this->
Matrix[1][0] = temp[1][0]; this->
Matrix[1][1] = temp[1][1]; this->
Matrix[1][2] = temp[1][2]; this->
Matrix[1][3] = temp[1][3];
154 this->
Matrix[2][0] = temp[2][0]; this->
Matrix[2][1] = temp[2][1]; this->
Matrix[2][2] = temp[2][2]; this->
Matrix[2][3] = temp[2][3];
155 this->
Matrix[3][0] = temp[3][0]; this->
Matrix[3][1] = temp[3][1]; this->
Matrix[3][2] = temp[3][2]; this->
Matrix[3][3] = temp[3][3];
171 for(
Whole Row = 0 ; Row < 4 ; ++Row )
173 for(
Whole Col = 0 ; Col < 4 ; ++Col )
184 for(
Whole Row = 0 ; Row < 4 ; ++Row )
186 for(
Whole Col = 0 ; Col < 4 ; ++Col )
332 Scalar * this->
Matrix[0][0], Scalar * this->Matrix[0][1], Scalar * this->Matrix[0][2], Scalar * this->Matrix[0][3],
333 Scalar * this->Matrix[1][0], Scalar * this->Matrix[1][1], Scalar * this->Matrix[1][2], Scalar * this->Matrix[1][3],
334 Scalar * this->Matrix[2][0], Scalar * this->Matrix[2][1], Scalar * this->Matrix[2][2], Scalar * this->Matrix[2][3],
335 Scalar * this->Matrix[3][0], Scalar * this->Matrix[3][1], Scalar * this->Matrix[3][2], Scalar * this->Matrix[3][3]);
340 this->
Matrix[0][0] *= Scalar; this->
Matrix[0][1] *= Scalar; this->
Matrix[0][2] *= Scalar; this->
Matrix[0][3] *= Scalar;
341 this->
Matrix[1][0] *= Scalar; this->
Matrix[1][1] *= Scalar; this->
Matrix[1][2] *= Scalar; this->
Matrix[1][3] *= Scalar;
342 this->
Matrix[2][0] *= Scalar; this->
Matrix[2][1] *= Scalar; this->
Matrix[2][2] *= Scalar; this->
Matrix[2][3] *= Scalar;
343 this->
Matrix[3][0] *= Scalar; this->
Matrix[3][1] *= Scalar; this->
Matrix[3][2] *= Scalar; this->
Matrix[3][3] *= Scalar;
352 for(
Whole Row = 0 ; Row < 4 ; ++Row )
354 for(
Whole Col = 0 ; Col < 4 ; ++Col )
381 return Matrix4x4(
Minor(1,2,3,1,2,3),-
Minor(0,2,3,1,2,3),
Minor(0,1,3,1,2,3),-
Minor(0,1,2,1,2,3),
382 -
Minor(1,2,3,0,2,3),
Minor(0,2,3,0,2,3),-
Minor(0,1,3,0,2,3),
Minor(0,1,2,0,2,3),
383 Minor(1,2,3,0,1,3),-
Minor(0,2,3,0,1,3),
Minor(0,1,3,0,1,3),-
Minor(0,1,2,0,1,3),
384 -
Minor(1,2,3,0,1,2),
Minor(0,2,3,0,1,2),-
Minor(0,1,3,0,1,2),
Minor(0,1,2,0,1,2));
394 Real v0 = m20 * m31 - m21 * m30;
395 Real v1 = m20 * m32 - m22 * m30;
396 Real v2 = m20 * m33 - m23 * m30;
397 Real v3 = m21 * m32 - m22 * m31;
398 Real v4 = m21 * m33 - m23 * m31;
399 Real v5 = m22 * m33 - m23 * m32;
401 Real t00 = + (v5 * m11 - v4 * m12 + v3 * m13);
402 Real t10 = - (v5 * m10 - v2 * m12 + v1 * m13);
403 Real t20 = + (v4 * m10 - v2 * m11 + v0 * m13);
404 Real t30 = - (v3 * m10 - v1 * m11 + v0 * m12);
406 Real invDet = 1 / (t00 * m00 + t10 * m01 + t20 * m02 + t30 * m03);
408 Real d00 = t00 * invDet;
409 Real d10 = t10 * invDet;
410 Real d20 = t20 * invDet;
411 Real d30 = t30 * invDet;
413 Real d01 = - (v5 * m01 - v4 * m02 + v3 * m03) * invDet;
414 Real d11 = + (v5 * m00 - v2 * m02 + v1 * m03) * invDet;
415 Real d21 = - (v4 * m00 - v2 * m01 + v0 * m03) * invDet;
416 Real d31 = + (v3 * m00 - v1 * m01 + v0 * m02) * invDet;
418 v0 = m10 * m31 - m11 * m30;
419 v1 = m10 * m32 - m12 * m30;
420 v2 = m10 * m33 - m13 * m30;
421 v3 = m11 * m32 - m12 * m31;
422 v4 = m11 * m33 - m13 * m31;
423 v5 = m12 * m33 - m13 * m32;
425 Real d02 = + (v5 * m01 - v4 * m02 + v3 * m03) * invDet;
426 Real d12 = - (v5 * m00 - v2 * m02 + v1 * m03) * invDet;
427 Real d22 = + (v4 * m00 - v2 * m01 + v0 * m03) * invDet;
428 Real d32 = - (v3 * m00 - v1 * m01 + v0 * m02) * invDet;
430 v0 = m21 * m10 - m20 * m11;
431 v1 = m22 * m10 - m20 * m12;
432 v2 = m23 * m10 - m20 * m13;
433 v3 = m22 * m11 - m21 * m12;
434 v4 = m23 * m11 - m21 * m13;
435 v5 = m23 * m12 - m22 * m13;
437 Real d03 = - (v5 * m01 - v4 * m02 + v3 * m03) * invDet;
438 Real d13 = + (v5 * m00 - v2 * m02 + v1 * m03) * invDet;
439 Real d23 = - (v4 * m00 - v2 * m01 + v0 * m03) * invDet;
440 Real d33 = + (v3 * m00 - v1 * m01 + v0 * m02) * invDet;
519 if( !CurrAttrib.
Empty() )
523 if( !CurrAttrib.
Empty() )
527 if( !CurrAttrib.
Empty() )
531 if( !CurrAttrib.
Empty() )
535 if( !CurrAttrib.
Empty() )
539 if( !CurrAttrib.
Empty() )
543 if( !CurrAttrib.
Empty() )
547 if( !CurrAttrib.
Empty() )
551 if( !CurrAttrib.
Empty() )
555 if( !CurrAttrib.
Empty() )
559 if( !CurrAttrib.
Empty() )
563 if( !CurrAttrib.
Empty() )
567 if( !CurrAttrib.
Empty() )
571 if( !CurrAttrib.
Empty() )
575 if( !CurrAttrib.
Empty() )
579 if( !CurrAttrib.
Empty() )