Fix negate_m3 (taking 4x4 matrix)
authorCampbell Barton <ideasman42@gmail.com>
Thu, 30 Oct 2014 09:26:22 +0000 (10:26 +0100)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 30 Oct 2014 09:29:37 +0000 (10:29 +0100)
Cycles bake used incorrectly.

source/blender/blenlib/BLI_math_matrix.h
source/blender/blenlib/intern/math_matrix.c
source/blender/editors/object/object_bake_api.c

index 732f4b66f38ed7a007f2ab8f31f9014c22e41eea..e58e42f3c2d7fc4fe551ce50f93c223853814989 100644 (file)
@@ -125,7 +125,7 @@ void mul_m3_fl(float R[3][3], float f);
 void mul_m4_fl(float R[4][4], float f);
 void mul_mat3_m4_fl(float R[4][4], float f);
 
-void negate_m3(float R[4][4]);
+void negate_m3(float R[3][3]);
 void negate_m4(float R[4][4]);
 
 bool invert_m3_ex(float m[3][3], const float epsilon);
index af42af885822c72268839b3a7f9cac9a5387349d..6b40f0cf28ed071991f772eef7565467cc472ded 100644 (file)
@@ -639,7 +639,7 @@ void mul_mat3_m4_fl(float m[4][4], float f)
                        m[i][j] *= f;
 }
 
-void negate_m3(float m[4][4])
+void negate_m3(float m[3][3])
 {
        int i, j;
 
index 5746f9efd56dcd39f20766a48aa296d13b97880c..4821ffd4119addc0f20800697de83ba7990ba03c 100644 (file)
@@ -768,7 +768,7 @@ static int bake(
                        normalize_m4_m4(highpoly[i].rotmat, highpoly[i].imat);
                        zero_v3(highpoly[i].rotmat[3]);
                        if (is_negative_m4(highpoly[i].rotmat))
-                               negate_m3(highpoly[i].rotmat);
+                               negate_m4(highpoly[i].rotmat);
 
                        i++;
                }