m.m[2][1] = 0;
m.m[2][2] = 1;
m.m[2][3] = 0;
- R_ConcatTransforms(&softwaretransform_matrix[0], &m.m[0], &rootmatrix.m[0]);
+ R_ConcatTransforms(&softwaretransform_matrix[0], &m.m[0][0], &rootmatrix.m[0][0]);
*/
// LordHavoc: combine transform from zym coordinate space to quake coordinate space with model to world transform matrix
m.m[2][2] = bone1->m[2][2] * lerp1 + bone2->m[2][2] * lerp2 + bone3->m[2][2] * lerp3 + bone4->m[2][2] * lerp4;
m.m[2][3] = bone1->m[2][3] * lerp1 + bone2->m[2][3] * lerp2 + bone3->m[2][3] * lerp3 + bone4->m[2][3] * lerp4;
if (bone->parent >= 0)
- R_ConcatTransforms(&zymbonepose[bone->parent].m[0], &m.m[0], &out->m[0]);
+ R_ConcatTransforms(&zymbonepose[bone->parent].m[0][0], &m.m[0][0], &out->m[0][0]);
else
- R_ConcatTransforms(&rootmatrix.m[0], &m.m[0], &out->m[0]);
+ R_ConcatTransforms(&rootmatrix.m[0][0], &m.m[0][0], &out->m[0][0]);
bone1++;
bone2++;
bone3++;
m.m[2][2] = bone1->m[2][2] * lerp1 + bone2->m[2][2] * lerp2 + bone3->m[2][2] * lerp3;
m.m[2][3] = bone1->m[2][3] * lerp1 + bone2->m[2][3] * lerp2 + bone3->m[2][3] * lerp3;
if (bone->parent >= 0)
- R_ConcatTransforms(&zymbonepose[bone->parent].m[0], &m.m[0], &out->m[0]);
+ R_ConcatTransforms(&zymbonepose[bone->parent].m[0][0], &m.m[0][0], &out->m[0][0]);
else
- R_ConcatTransforms(&rootmatrix.m[0], &m.m[0], &out->m[0]);
+ R_ConcatTransforms(&rootmatrix.m[0][0], &m.m[0][0], &out->m[0][0]);
bone1++;
bone2++;
bone3++;
m.m[2][2] = bone1->m[2][2] * lerp1 + bone2->m[2][2] * lerp2;
m.m[2][3] = bone1->m[2][3] * lerp1 + bone2->m[2][3] * lerp2;
if (bone->parent >= 0)
- R_ConcatTransforms(&zymbonepose[bone->parent].m[0], &m.m[0], &out->m[0]);
+ R_ConcatTransforms(&zymbonepose[bone->parent].m[0][0], &m.m[0][0], &out->m[0][0]);
else
- R_ConcatTransforms(&rootmatrix.m[0], &m.m[0], &out->m[0]);
+ R_ConcatTransforms(&rootmatrix.m[0][0], &m.m[0][0], &out->m[0][0]);
bone1++;
bone2++;
bone++;
m.m[2][2] = bone1->m[2][2] * lerp1;
m.m[2][3] = bone1->m[2][3] * lerp1;
if (bone->parent >= 0)
- R_ConcatTransforms(&zymbonepose[bone->parent].m[0], &m.m[0], &out->m[0]);
+ R_ConcatTransforms(&zymbonepose[bone->parent].m[0][0], &m.m[0][0], &out->m[0][0]);
else
- R_ConcatTransforms(&rootmatrix.m[0], &m.m[0], &out->m[0]);
+ R_ConcatTransforms(&rootmatrix.m[0][0], &m.m[0][0], &out->m[0][0]);
bone1++;
bone++;
}
for (i = 0, out = zymbonepose;i < count;i++, out++)
{
if (bone->parent >= 0)
- R_ConcatTransforms(&zymbonepose[bone->parent].m[0], &bone1->m[0], &out->m[0]);
+ R_ConcatTransforms(&zymbonepose[bone->parent].m[0][0], &bone1->m[0][0], &out->m[0][0]);
else
- R_ConcatTransforms(&rootmatrix.m[0], &bone1->m[0], &out->m[0]);
+ R_ConcatTransforms(&rootmatrix.m[0][0], &bone1->m[0][0], &out->m[0][0]);
bone1++;
bone++;
}
R_ConcatRotations
================
*/
-void R_ConcatRotations (const float in1[3][3], const float in2[3][3], float out[3][3])
+void R_ConcatRotations (const float in1[3*3], const float in2[3*3], float out[3*3])
{
- out[0][0] = in1[0][0] * in2[0][0] + in1[0][1] * in2[1][0] + in1[0][2] * in2[2][0];
- out[0][1] = in1[0][0] * in2[0][1] + in1[0][1] * in2[1][1] + in1[0][2] * in2[2][1];
- out[0][2] = in1[0][0] * in2[0][2] + in1[0][1] * in2[1][2] + in1[0][2] * in2[2][2];
- out[1][0] = in1[1][0] * in2[0][0] + in1[1][1] * in2[1][0] + in1[1][2] * in2[2][0];
- out[1][1] = in1[1][0] * in2[0][1] + in1[1][1] * in2[1][1] + in1[1][2] * in2[2][1];
- out[1][2] = in1[1][0] * in2[0][2] + in1[1][1] * in2[1][2] + in1[1][2] * in2[2][2];
- out[2][0] = in1[2][0] * in2[0][0] + in1[2][1] * in2[1][0] + in1[2][2] * in2[2][0];
- out[2][1] = in1[2][0] * in2[0][1] + in1[2][1] * in2[1][1] + in1[2][2] * in2[2][1];
- out[2][2] = in1[2][0] * in2[0][2] + in1[2][1] * in2[1][2] + in1[2][2] * in2[2][2];
+ out[0*3+ 0] = in1[0*3+ 0] * in2[0*3+ 0] + in1[0*3+ 1] * in2[1*3+ 0] + in1[0*3+ 2] * in2[2*3+ 0];
+ out[0*3+ 1] = in1[0*3+ 0] * in2[0*3+ 1] + in1[0*3+ 1] * in2[1*3+ 1] + in1[0*3+ 2] * in2[2*3+ 1];
+ out[0*3+ 2] = in1[0*3+ 0] * in2[0*3+ 2] + in1[0*3+ 1] * in2[1*3+ 2] + in1[0*3+ 2] * in2[2*3+ 2];
+ out[1*3+ 0] = in1[1*3+ 0] * in2[0*3+ 0] + in1[1*3+ 1] * in2[1*3+ 0] + in1[1*3+ 2] * in2[2*3+ 0];
+ out[1*3+ 1] = in1[1*3+ 0] * in2[0*3+ 1] + in1[1*3+ 1] * in2[1*3+ 1] + in1[1*3+ 2] * in2[2*3+ 1];
+ out[1*3+ 2] = in1[1*3+ 0] * in2[0*3+ 2] + in1[1*3+ 1] * in2[1*3+ 2] + in1[1*3+ 2] * in2[2*3+ 2];
+ out[2*3+ 0] = in1[2*3+ 0] * in2[0*3+ 0] + in1[2*3+ 1] * in2[1*3+ 0] + in1[2*3+ 2] * in2[2*3+ 0];
+ out[2*3+ 1] = in1[2*3+ 0] * in2[0*3+ 1] + in1[2*3+ 1] * in2[1*3+ 1] + in1[2*3+ 2] * in2[2*3+ 1];
+ out[2*3+ 2] = in1[2*3+ 0] * in2[0*3+ 2] + in1[2*3+ 1] * in2[1*3+ 2] + in1[2*3+ 2] * in2[2*3+ 2];
}
R_ConcatTransforms
================
*/
-void R_ConcatTransforms (const float in1[3][4], const float in2[3][4], float out[3][4])
+void R_ConcatTransforms (const float in1[3*4], const float in2[3*4], float out[3*4])
{
- out[0][0] = in1[0][0] * in2[0][0] + in1[0][1] * in2[1][0] + in1[0][2] * in2[2][0];
- out[0][1] = in1[0][0] * in2[0][1] + in1[0][1] * in2[1][1] + in1[0][2] * in2[2][1];
- out[0][2] = in1[0][0] * in2[0][2] + in1[0][1] * in2[1][2] + in1[0][2] * in2[2][2];
- out[0][3] = in1[0][0] * in2[0][3] + in1[0][1] * in2[1][3] + in1[0][2] * in2[2][3] + in1[0][3];
- out[1][0] = in1[1][0] * in2[0][0] + in1[1][1] * in2[1][0] + in1[1][2] * in2[2][0];
- out[1][1] = in1[1][0] * in2[0][1] + in1[1][1] * in2[1][1] + in1[1][2] * in2[2][1];
- out[1][2] = in1[1][0] * in2[0][2] + in1[1][1] * in2[1][2] + in1[1][2] * in2[2][2];
- out[1][3] = in1[1][0] * in2[0][3] + in1[1][1] * in2[1][3] + in1[1][2] * in2[2][3] + in1[1][3];
- out[2][0] = in1[2][0] * in2[0][0] + in1[2][1] * in2[1][0] + in1[2][2] * in2[2][0];
- out[2][1] = in1[2][0] * in2[0][1] + in1[2][1] * in2[1][1] + in1[2][2] * in2[2][1];
- out[2][2] = in1[2][0] * in2[0][2] + in1[2][1] * in2[1][2] + in1[2][2] * in2[2][2];
- out[2][3] = in1[2][0] * in2[0][3] + in1[2][1] * in2[1][3] + in1[2][2] * in2[2][3] + in1[2][3];
+ out[0*4+0] = in1[0*4+0] * in2[0*4+0] + in1[0*4+1] * in2[1*4+0] + in1[0*4+2] * in2[2*4+0];
+ out[0*4+1] = in1[0*4+0] * in2[0*4+1] + in1[0*4+1] * in2[1*4+1] + in1[0*4+2] * in2[2*4+1];
+ out[0*4+2] = in1[0*4+0] * in2[0*4+2] + in1[0*4+1] * in2[1*4+2] + in1[0*4+2] * in2[2*4+2];
+ out[0*4+3] = in1[0*4+0] * in2[0*4+3] + in1[0*4+1] * in2[1*4+3] + in1[0*4+2] * in2[2*4+3] + in1[0*4+3];
+ out[1*4+0] = in1[1*4+0] * in2[0*4+0] + in1[1*4+1] * in2[1*4+0] + in1[1*4+2] * in2[2*4+0];
+ out[1*4+1] = in1[1*4+0] * in2[0*4+1] + in1[1*4+1] * in2[1*4+1] + in1[1*4+2] * in2[2*4+1];
+ out[1*4+2] = in1[1*4+0] * in2[0*4+2] + in1[1*4+1] * in2[1*4+2] + in1[1*4+2] * in2[2*4+2];
+ out[1*4+3] = in1[1*4+0] * in2[0*4+3] + in1[1*4+1] * in2[1*4+3] + in1[1*4+2] * in2[2*4+3] + in1[1*4+3];
+ out[2*4+0] = in1[2*4+0] * in2[0*4+0] + in1[2*4+1] * in2[1*4+0] + in1[2*4+2] * in2[2*4+0];
+ out[2*4+1] = in1[2*4+0] * in2[0*4+1] + in1[2*4+1] * in2[1*4+1] + in1[2*4+2] * in2[2*4+1];
+ out[2*4+2] = in1[2*4+0] * in2[0*4+2] + in1[2*4+1] * in2[1*4+2] + in1[2*4+2] * in2[2*4+2];
+ out[2*4+3] = in1[2*4+0] * in2[0*4+3] + in1[2*4+1] * in2[1*4+3] + in1[2*4+2] * in2[2*4+3] + in1[2*4+3];
}
qbyte NormalToByte(const vec3_t n);
void ByteToNormal(qbyte num, vec3_t n);
-void R_ConcatRotations (const float in1[3][3], const float in2[3][3], float out[3][3]);
-void R_ConcatTransforms (const float in1[3][4], const float in2[3][4], float out[3][4]);
+void R_ConcatRotations (const float in1[3*3], const float in2[3*3], float out[3*3]);
+void R_ConcatTransforms (const float in1[3*4], const float in2[3*4], float out[3*4]);
void AngleVectors (const vec3_t angles, vec3_t forward, vec3_t right, vec3_t up);
// LordHavoc: proper matrix version of AngleVectors
VectorCopy(vpn, matrix2[0]);
VectorNegate(vright, matrix2[1]);
VectorCopy(vup, matrix2[2]);
- R_ConcatRotations (matrix1, matrix2, matrix3);
+ R_ConcatRotations (matrix1[0], matrix2[0], matrix3[0]);
break;
}