26 double m00,
double m01,
double m02,
double m03,
27 double m10,
double m11,
double m12,
double m13,
28 double m20,
double m21,
double m22,
double m23,
29 double m30,
double m31,
double m32,
double m33 )
69 inline void convert(
double mat[16])
89 inline double* operator [] (
unsigned int iRow )
95 inline const double *operator [] (
unsigned int iRow )
const
104 r.m[0][0] = m[0][0] * m2.m[0][0] + m[0][1] * m2.m[1][0] + m[0][2] * m2.m[2][0] + m[0][3] * m2.m[3][0];
105 r.m[0][1] = m[0][0] * m2.m[0][1] + m[0][1] * m2.m[1][1] + m[0][2] * m2.m[2][1] + m[0][3] * m2.m[3][1];
106 r.m[0][2] = m[0][0] * m2.m[0][2] + m[0][1] * m2.m[1][2] + m[0][2] * m2.m[2][2] + m[0][3] * m2.m[3][2];
107 r.m[0][3] = m[0][0] * m2.m[0][3] + m[0][1] * m2.m[1][3] + m[0][2] * m2.m[2][3] + m[0][3] * m2.m[3][3];
109 r.m[1][0] = m[1][0] * m2.m[0][0] + m[1][1] * m2.m[1][0] + m[1][2] * m2.m[2][0] + m[1][3] * m2.m[3][0];
110 r.m[1][1] = m[1][0] * m2.m[0][1] + m[1][1] * m2.m[1][1] + m[1][2] * m2.m[2][1] + m[1][3] * m2.m[3][1];
111 r.m[1][2] = m[1][0] * m2.m[0][2] + m[1][1] * m2.m[1][2] + m[1][2] * m2.m[2][2] + m[1][3] * m2.m[3][2];
112 r.m[1][3] = m[1][0] * m2.m[0][3] + m[1][1] * m2.m[1][3] + m[1][2] * m2.m[2][3] + m[1][3] * m2.m[3][3];
114 r.m[2][0] = m[2][0] * m2.m[0][0] + m[2][1] * m2.m[1][0] + m[2][2] * m2.m[2][0] + m[2][3] * m2.m[3][0];
115 r.m[2][1] = m[2][0] * m2.m[0][1] + m[2][1] * m2.m[1][1] + m[2][2] * m2.m[2][1] + m[2][3] * m2.m[3][1];
116 r.m[2][2] = m[2][0] * m2.m[0][2] + m[2][1] * m2.m[1][2] + m[2][2] * m2.m[2][2] + m[2][3] * m2.m[3][2];
117 r.m[2][3] = m[2][0] * m2.m[0][3] + m[2][1] * m2.m[1][3] + m[2][2] * m2.m[2][3] + m[2][3] * m2.m[3][3];
119 r.m[3][0] = m[3][0] * m2.m[0][0] + m[3][1] * m2.m[1][0] + m[3][2] * m2.m[2][0] + m[3][3] * m2.m[3][0];
120 r.m[3][1] = m[3][0] * m2.m[0][1] + m[3][1] * m2.m[1][1] + m[3][2] * m2.m[2][1] + m[3][3] * m2.m[3][1];
121 r.m[3][2] = m[3][0] * m2.m[0][2] + m[3][1] * m2.m[1][2] + m[3][2] * m2.m[2][2] + m[3][3] * m2.m[3][2];
122 r.m[3][3] = m[3][0] * m2.m[0][3] + m[3][1] * m2.m[1][3] + m[3][2] * m2.m[2][3] + m[3][3] * m2.m[3][3];
131 return concatenate( m2 );
147 double fInvW = 1.0f / ( m[3][0] * v.x + m[3][1] * v.y + m[3][2] * v.z + m[3][3] );
149 r.x = ( m[0][0] * v.x + m[0][1] * v.y + m[0][2] * v.z + m[0][3] ) * fInvW;
150 r.y = ( m[1][0] * v.x + m[1][1] * v.y + m[1][2] * v.z + m[1][3] ) * fInvW;
151 r.z = ( m[2][0] * v.x + m[2][1] * v.y + m[2][2] * v.z + m[2][3] ) * fInvW;
163 r.m[0][0] = m[0][0] + m2.m[0][0];
164 r.m[0][1] = m[0][1] + m2.m[0][1];
165 r.m[0][2] = m[0][2] + m2.m[0][2];
166 r.m[0][3] = m[0][3] + m2.m[0][3];
168 r.m[1][0] = m[1][0] + m2.m[1][0];
169 r.m[1][1] = m[1][1] + m2.m[1][1];
170 r.m[1][2] = m[1][2] + m2.m[1][2];
171 r.m[1][3] = m[1][3] + m2.m[1][3];
173 r.m[2][0] = m[2][0] + m2.m[2][0];
174 r.m[2][1] = m[2][1] + m2.m[2][1];
175 r.m[2][2] = m[2][2] + m2.m[2][2];
176 r.m[2][3] = m[2][3] + m2.m[2][3];
178 r.m[3][0] = m[3][0] + m2.m[3][0];
179 r.m[3][1] = m[3][1] + m2.m[3][1];
180 r.m[3][2] = m[3][2] + m2.m[3][2];
181 r.m[3][3] = m[3][3] + m2.m[3][3];
191 r.m[0][0] = m[0][0] - m2.m[0][0];
192 r.m[0][1] = m[0][1] - m2.m[0][1];
193 r.m[0][2] = m[0][2] - m2.m[0][2];
194 r.m[0][3] = m[0][3] - m2.m[0][3];
196 r.m[1][0] = m[1][0] - m2.m[1][0];
197 r.m[1][1] = m[1][1] - m2.m[1][1];
198 r.m[1][2] = m[1][2] - m2.m[1][2];
199 r.m[1][3] = m[1][3] - m2.m[1][3];
201 r.m[2][0] = m[2][0] - m2.m[2][0];
202 r.m[2][1] = m[2][1] - m2.m[2][1];
203 r.m[2][2] = m[2][2] - m2.m[2][2];
204 r.m[2][3] = m[2][3] - m2.m[2][3];
206 r.m[3][0] = m[3][0] - m2.m[3][0];
207 r.m[3][1] = m[3][1] - m2.m[3][1];
208 r.m[3][2] = m[3][2] - m2.m[3][2];
209 r.m[3][3] = m[3][3] - m2.m[3][3];
219 m[0][0] != m2.m[0][0] || m[0][1] != m2.m[0][1] || m[0][2] != m2.m[0][2] || m[0][3] != m2.m[0][3] ||
220 m[1][0] != m2.m[1][0] || m[1][1] != m2.m[1][1] || m[1][2] != m2.m[1][2] || m[1][3] != m2.m[1][3] ||
221 m[2][0] != m2.m[2][0] || m[2][1] != m2.m[2][1] || m[2][2] != m2.m[2][2] || m[2][3] != m2.m[2][3] ||
222 m[3][0] != m2.m[3][0] || m[3][1] != m2.m[3][1] || m[3][2] != m2.m[3][2] || m[3][3] != m2.m[3][3] )
232 m[0][0] != m2.m[0][0] || m[0][1] != m2.m[0][1] || m[0][2] != m2.m[0][2] || m[0][3] != m2.m[0][3] ||
233 m[1][0] != m2.m[1][0] || m[1][1] != m2.m[1][1] || m[1][2] != m2.m[1][2] || m[1][3] != m2.m[1][3] ||
234 m[2][0] != m2.m[2][0] || m[2][1] != m2.m[2][1] || m[2][2] != m2.m[2][2] || m[2][3] != m2.m[2][3] ||
235 m[3][0] != m2.m[3][0] || m[3][1] != m2.m[3][1] || m[3][2] != m2.m[3][2] || m[3][3] != m2.m[3][3] )
240 inline Matrix4 transpose(
void)
const
242 return Matrix4(m[0][0], m[1][0], m[2][0], m[3][0],
243 m[0][1], m[1][1], m[2][1], m[3][1],
244 m[0][2], m[1][2], m[2][2], m[3][2],
245 m[0][3], m[1][3], m[2][3], m[3][3]);
248 inline void makeTrans(
double tx,
double ty,
double tz )
250 m[0][0] = 1.0; m[0][1] = 0.0; m[0][2] = 0.0; m[0][3] = tx;
251 m[1][0] = 0.0; m[1][1] = 1.0; m[1][2] = 0.0; m[1][3] = ty;
252 m[2][0] = 0.0; m[2][1] = 0.0; m[2][2] = 1.0; m[2][3] = tz;
253 m[3][0] = 0.0; m[3][1] = 0.0; m[3][2] = 0.0; m[3][3] = 1.0;
262 scalar*m[0][0], scalar*m[0][1], scalar*m[0][2], scalar*m[0][3],
263 scalar*m[1][0], scalar*m[1][1], scalar*m[1][2], scalar*m[1][3],
264 scalar*m[2][0], scalar*m[2][1], scalar*m[2][2], scalar*m[2][3],
265 scalar*m[3][0], scalar*m[3][1], scalar*m[3][2], scalar*m[3][3]);