14 #ifndef PX_FOUNDATION_PX_MAT33_H
15 #define PX_FOUNDATION_PX_MAT33_H
83 : column0(1.0f,0.0f,0.0f), column1(0.0f,1.0f,0.0f), column2(0.0f,0.0f,1.0f)
90 : column0(0.0f), column1(0.0f), column2(0.0f)
98 : column0(col0), column1(col1), column2(col2)
104 : column0(r,0.0f,0.0f), column1(0.0f,r,0.0f), column2(0.0f,0.0f,r)
110 column0(values[0],values[1],values[2]),
111 column1(values[3],values[4],values[5]),
112 column2(values[6],values[7],values[8])
140 column0 =
PxVec3(1.0f - yy - zz, xy + zw, xz - yw);
141 column1 =
PxVec3(xy - zw, 1.0f - xx - zz, yz + xw);
142 column2 =
PxVec3(xz + yw, yz - xw, 1.0f - xx - yy);
147 : column0(other.column0), column1(other.column1), column2(other.column2)
187 const PxVec3 v0(column0.x, column1.x, column2.x);
188 const PxVec3 v1(column0.y, column1.y, column2.y);
189 const PxVec3 v2(column0.z, column1.z, column2.z);
197 const PxReal det = getDeterminant();
202 const PxReal invDet = 1.0f/det;
204 inverse.
column0[0] = invDet * (column1[1]*column2[2] - column2[1]*column1[2]);
205 inverse.
column0[1] = invDet *-(column0[1]*column2[2] - column2[1]*column0[2]);
206 inverse.
column0[2] = invDet * (column0[1]*column1[2] - column0[2]*column1[1]);
208 inverse.
column1[0] = invDet *-(column1[0]*column2[2] - column1[2]*column2[0]);
209 inverse.
column1[1] = invDet * (column0[0]*column2[2] - column0[2]*column2[0]);
210 inverse.
column1[2] = invDet *-(column0[0]*column1[2] - column0[2]*column1[0]);
212 inverse.
column2[0] = invDet * (column1[0]*column2[1] - column1[1]*column2[0]);
213 inverse.
column2[1] = invDet *-(column0[0]*column2[1] - column0[1]*column2[0]);
214 inverse.
column2[2] = invDet * (column0[0]*column1[1] - column1[0]*column0[1]);
220 return createIdentity();
227 return column0.dot(column1.cross(column2));
233 return PxMat33(-column0, -column1, -column2);
255 return PxMat33(column0*scalar, column1*scalar, column2*scalar);
263 return transform(vec);
307 *
this = *
this * other;
315 return (*
this)[col][row];
321 return (*
this)[col][row];
329 return column0*other.
x + column1*other.
y + column2*other.
z;
335 return PxVec3( column0.dot(other),
359 PxReal tr = m(0,0) + m(1,1) + m(2,2), h;
366 x = (m(2,1) - m(1,2)) * h;
367 y = (m(0,2) - m(2,0)) * h;
368 z = (m(1,0) - m(0,1)) * h;
380 h =
PxSqrt((m(0,0) - (m(1,1) + m(2,2))) + 1);
384 y = (m(0,1) + m(1,0)) * h;
385 z = (m(2,0) + m(0,2)) * h;
386 w = (m(2,1) - m(1,2)) * h;
389 h =
PxSqrt((m(1,1) - (m(2,2) + m(0,0))) + 1);
393 z = (m(1,2) + m(2,1)) * h;
394 x = (m(0,1) + m(1,0)) * h;
395 w = (m(0,2) - m(2,0)) * h;
398 h =
PxSqrt((m(2,2) - (m(0,0) + m(1,1))) + 1);
402 x = (m(2,0) + m(0,2)) * h;
403 y = (m(1,2) + m(2,1)) * h;
404 w = (m(1,0) - m(0,1)) * h;
418 #endif // PX_FOUNDATION_PX_MAT33_H