14 #ifndef PX_FOUNDATION_PX_MAT44_H
15 #define PX_FOUNDATION_PX_MAT44_H
47 : column0(1.0f,0.0f,0.0f,0.0f), column1(0.0f,1.0f,0.0f,0.0f), column2(0.0f,0.0f,1.0f,0.0f), column3(0.0f,0.0f,0.0f,1.0f)
61 : column0(col0), column1(col1), column2(col2), column3(col3)
66 : column0(r,0.0f,0.0f,0.0f), column1(0.0f,r,0.0f,0.0f), column2(0.0f,0.0f,r,0.0f), column3(0.0f,0.0f,0.0f,r)
72 : column0(col0,0), column1(col1,0), column2(col2,0), column3(col3,1.0f)
77 column0(values[0],values[1],values[2], values[3]),
78 column1(values[4],values[5],values[6], values[7]),
79 column2(values[8],values[9],values[10], values[11]),
80 column3(values[12], values[13], values[14], values[15])
108 column0 =
PxVec4(1.0f - yy - zz, xy + zw, xz - yw, 0.0f);
109 column1 =
PxVec4(xy - zw, 1.0f - xx - zz, yz + xw, 0.0f);
110 column2 =
PxVec4(xz + yw, yz - xw, 1.0f - xx - yy, 0.0f);
111 column3 =
PxVec4(0.0f, 0.0f, 0.0f, 1.0f);
116 column0(diagonal.x,0.0f,0.0f,0.0f),
117 column1(0.0f,diagonal.y,0.0f,0.0f),
118 column2(0.0f,0.0f,diagonal.z,0.0f),
119 column3(0.0f,0.0f,0.0f,diagonal.w)
124 column0(orientation.column0,0.0f),
125 column1(orientation.column1,0.0f),
126 column2(orientation.column2,0.0f),
127 column3(position,1.0f)
144 : column0(other.column0), column1(other.column1), column2(other.column2), column3(other.column3)
173 return PxMat44(
PxVec4(column0.x, column1.x, column2.x, column3.x),
174 PxVec4(column0.y, column1.y, column2.y, column3.y),
175 PxVec4(column0.z, column1.z, column2.z, column3.z),
176 PxVec4(column0.w, column1.w, column2.w, column3.w));
182 return PxMat44(-column0, -column1, -column2, -column3);
206 return PxMat44(column0*scalar, column1*scalar, column2*scalar, column3*scalar);
254 *
this = *
this * other;
262 return (*
this)[col][row];
268 return (*
this)[col][row];
274 return column0*other.
x + column1*other.
y + column2*other.
z + column3*other.
w;
280 return transform(
PxVec4(other,1.0f)).getXYZ();
286 return column0*other.
x + column1*other.
y + column2*other.
z;
292 return rotate(
PxVec4(other,1.0f)).getXYZ();
299 return (&column0)[num].getXYZ();
304 return column3.getXYZ();
309 column3.x = position.
x;
310 column3.y = position.
y;
311 column3.z = position.
z;
335 PxVec3 r0(column0.x, column1.x, column2.x),
336 r1(column0.y, column1.y, column2.y),
337 r2(column0.z, column1.z, column2.z);
339 return PxMat44(r0, r1, r2, -(r0 * column3.x + r1 * column3.y + r2 * column3.
z));
344 return column0.isFinite() && column1.isFinite() && column2.isFinite() && column3.isFinite();
369 #endif // PX_FOUNDATION_PX_MAT44_H