Merge -c 28014 from COLLADA branch into trunk.
[blender.git] / source / blender / collada / collada_internal.h
index 9a8f1b17a0bc25766d21234b4170ecf5320f1124..278cd37ac66b18b98233adea98cbb70f3bb2549e 100644 (file)
@@ -26,7 +26,7 @@ public:
                
        // TODO need also for angle conversion, time conversion...
 
-       void mat4_from_dae(float out[][4], const COLLADABU::Math::Matrix4& in)
+       void dae_matrix_to_mat4(float out[][4], const COLLADABU::Math::Matrix4& in)
        {
                // in DAE, matrices use columns vectors, (see comments in COLLADABUMathMatrix4.h)
                // so here, to make a blender matrix, we swap columns and rows
@@ -39,19 +39,33 @@ public:
 
        void mat4_to_dae(float out[][4], float in[][4])
        {
-               Mat4CpyMat4(out, in);
-               Mat4Transp(out);
+               copy_m4_m4(out, in);
+               transpose_m4(out);
        }
 
-       void mat4_to_dae(double out[][4], float in[][4])
+       void mat4_to_dae_double(double out[][4], float in[][4])
        {
-               float outf[4][4];
+               float mat[4][4];
 
-               mat4_to_dae(outf, in);
+               mat4_to_dae(mat, in);
 
                for (int i = 0; i < 4; i++)
                        for (int j = 0; j < 4; j++)
-                               out[i][j] = outf[i][j];
+                               out[i][j] = mat[i][j];
+       }
+};
+
+class TransformBase
+{
+public:
+       void decompose(float mat[][4], float *loc, float eul[3], float quat[4], float *size)
+       {
+               mat4_to_size(size, mat);
+               if (eul)
+                       mat4_to_eul(eul, mat);
+               if (quat)
+                       mat4_to_quat(quat, mat);
+               copy_v3_v3(loc, mat[3]);
        }
 };