#endif
}
-void Matrix4x4_ToArray12FloatGL(const matrix4x4_t *in, float out[12])
+void Matrix4x4_ToArray12FloatGL(const matrix4x4_t *in, float out[4][3])
{
#ifdef MATRIX4x4_OPENGLORIENTATION
- out[ 0] = in->m[0][0];
- out[ 1] = in->m[0][1];
- out[ 2] = in->m[0][2];
- out[ 3] = in->m[1][0];
- out[ 4] = in->m[1][1];
- out[ 5] = in->m[1][2];
- out[ 6] = in->m[2][0];
- out[ 7] = in->m[2][1];
- out[ 8] = in->m[2][2];
- out[ 9] = in->m[3][0];
- out[10] = in->m[3][1];
- out[11] = in->m[3][2];
+ out[0][0] = in->m[0][0];
+ out[0][1] = in->m[0][1];
+ out[0][2] = in->m[0][2];
+ out[1][0] = in->m[1][0];
+ out[1][1] = in->m[1][1];
+ out[1][2] = in->m[1][2];
+ out[2][0] = in->m[2][0];
+ out[2][1] = in->m[2][1];
+ out[2][2] = in->m[2][2];
+ out[3][0] = in->m[3][0];
+ out[3][1] = in->m[3][1];
+ out[3][2] = in->m[3][2];
#else
- out[ 0] = in->m[0][0];
- out[ 1] = in->m[1][0];
- out[ 2] = in->m[2][0];
- out[ 3] = in->m[0][1];
- out[ 4] = in->m[1][1];
- out[ 5] = in->m[2][1];
- out[ 6] = in->m[0][2];
- out[ 7] = in->m[1][2];
- out[ 8] = in->m[2][2];
- out[ 9] = in->m[0][3];
- out[10] = in->m[1][3];
- out[11] = in->m[2][3];
+ out[0][0] = in->m[0][0];
+ out[0][1] = in->m[1][0];
+ out[0][2] = in->m[2][0];
+ out[1][0] = in->m[0][1];
+ out[1][1] = in->m[1][1];
+ out[1][2] = in->m[2][1];
+ out[2][0] = in->m[0][2];
+ out[2][1] = in->m[1][2];
+ out[2][2] = in->m[2][2];
+ out[3][0] = in->m[0][3];
+ out[3][1] = in->m[1][3];
+ out[3][2] = in->m[2][3];
#endif
}
void Matrix4x4_FromArrayFloatD3D(matrix4x4_t *out, const float in[16]);
// converts a matrix4x4 to a float[12] array in the OpenGL orientation
-void Matrix4x4_ToArray12FloatGL(const matrix4x4_t *in, float out[12]);
+void Matrix4x4_ToArray12FloatGL(const matrix4x4_t *in, float out[4][3]);
// creates a matrix4x4 from a float[12] array in the OpenGL orientation
void Matrix4x4_FromArray12FloatGL(matrix4x4_t *out, const float in[12]);
// converts a matrix4x4 to a float[12] array in the Direct3D orientation
// strangely the smd angles are for a transposed matrix, so we
// have to generate a transposed matrix, then convert that...
Matrix4x4_FromBonePose7s(&posematrix, model->num_posescale, model->data_poses7s + 7*(model->num_bones * poseindex + transformindex));
- Matrix4x4_ToArray12FloatGL(&posematrix, mtest[0]);
+ Matrix4x4_ToArray12FloatGL(&posematrix, mtest);
AnglesFromVectors(angles, mtest[0], mtest[2], false);
if (angles[0] >= 180) angles[0] -= 360;
if (angles[1] >= 180) angles[1] -= 360;