[Bf-blender-cvs] [6f1f577] master: Correction to 7c7b730, multiplication order was flipped

Sergey Sharybin noreply at git.blender.org
Sun Jul 20 16:50:49 CEST 2014


Commit: 6f1f5771ff0440ffd551a93f8c1a6e865f3b1529
Author: Sergey Sharybin
Date:   Sun Jul 20 20:44:42 2014 +0600
Branches: master
https://developer.blender.org/rB6f1f5771ff0440ffd551a93f8c1a6e865f3b1529

Correction to 7c7b730, multiplication order was flipped

That's really annoying that multiplication order is flipped
comparing mat3 and mat4 cases, but for the purposes of not
breaking all the branches which might use this stuff we'd
better keep order consistent with old version for now.

Suggestion here would be to make order consistent but rename
this functions to mult_* to make compilation fail instead
of failing and using wrong order silently.

===================================================================

M	source/blender/blenlib/intern/math_matrix.c

===================================================================

diff --git a/source/blender/blenlib/intern/math_matrix.c b/source/blender/blenlib/intern/math_matrix.c
index 74b0df1..1a4beab 100644
--- a/source/blender/blenlib/intern/math_matrix.c
+++ b/source/blender/blenlib/intern/math_matrix.c
@@ -352,68 +352,68 @@ void _va_mul_serie_m4_3(
         float r[4][4],
         float m1[4][4], float m2[4][4])
 {
-	mul_m4_m4m4(r, m2, m1);
+	mul_m4_m4m4(r, m1, m2);
 }
 void _va_mul_serie_m4_4(
         float r[4][4],
         float m1[4][4], float m2[4][4], float m3[4][4])
 {
-	mul_m4_m4m4(r, m2, m1);
-	mul_m4_m4m4(r, m3, r);
+	mul_m4_m4m4(r, m1, m2);
+	mul_m4_m4m4(r, r, m3);
 }
 void _va_mul_serie_m4_5(
         float r[4][4],
         float m1[4][4], float m2[4][4], float m3[4][4], float m4[4][4])
 {
-	mul_m4_m4m4(r, m2, m1);
-	mul_m4_m4m4(r, m3, r);
-	mul_m4_m4m4(r, m4, r);
+	mul_m4_m4m4(r, m1, m2);
+	mul_m4_m4m4(r, r, m3);
+	mul_m4_m4m4(r, r, m4);
 }
 void _va_mul_serie_m4_6(
         float r[4][4],
         float m1[4][4], float m2[4][4], float m3[4][4], float m4[4][4],
         float m5[4][4])
 {
-	mul_m4_m4m4(r, m2, m1);
-	mul_m4_m4m4(r, m3, r);
-	mul_m4_m4m4(r, m4, r);
-	mul_m4_m4m4(r, m5, r);
+	mul_m4_m4m4(r, m1, m2);
+	mul_m4_m4m4(r, r, m3);
+	mul_m4_m4m4(r, r, m4);
+	mul_m4_m4m4(r, r, m5);
 }
 void _va_mul_serie_m4_7(
         float r[4][4],
         float m1[4][4], float m2[4][4], float m3[4][4], float m4[4][4],
         float m5[4][4], float m6[4][4])
 {
-	mul_m4_m4m4(r, m2, m1);
-	mul_m4_m4m4(r, m3, r);
-	mul_m4_m4m4(r, m4, r);
-	mul_m4_m4m4(r, m5, r);
-	mul_m4_m4m4(r, m6, r);
+	mul_m4_m4m4(r, m1, m2);
+	mul_m4_m4m4(r, r, m3);
+	mul_m4_m4m4(r, r, m4);
+	mul_m4_m4m4(r, r, m5);
+	mul_m4_m4m4(r, r, m6);
 }
 void _va_mul_serie_m4_8(
         float r[4][4],
         float m1[4][4], float m2[4][4], float m3[4][4], float m4[4][4],
         float m5[4][4], float m6[4][4], float m7[4][4])
 {
-	mul_m4_m4m4(r, m2, m1);
-	mul_m4_m4m4(r, m3, r);
-	mul_m4_m4m4(r, m4, r);
-	mul_m4_m4m4(r, m5, r);
-	mul_m4_m4m4(r, m6, r);
-	mul_m4_m4m4(r, m7, r);
+	mul_m4_m4m4(r, m1, m2);
+	mul_m4_m4m4(r, r, m3);
+	mul_m4_m4m4(r, r, m4);
+	mul_m4_m4m4(r, r, m5);
+	mul_m4_m4m4(r, r, m6);
+	mul_m4_m4m4(r, r, m7);
 }
 void _va_mul_serie_m4_9(
         float r[4][4],
         float m1[4][4], float m2[4][4], float m3[4][4], float m4[4][4],
         float m5[4][4], float m6[4][4], float m7[4][4], float m8[4][4])
 {
-	mul_m4_m4m4(r, m2, m1);
-	mul_m4_m4m4(r, m3, r);
-	mul_m4_m4m4(r, m4, r);
-	mul_m4_m4m4(r, m5, r);
-	mul_m4_m4m4(r, m6, r);
-	mul_m4_m4m4(r, m7, r);
-	mul_m4_m4m4(r, m8, r);
+	mul_m4_m4m4(r, m1, m2);
+	mul_m4_m4m4(r, r, m3);
+	mul_m4_m4m4(r, r, m4);
+	mul_m4_m4m4(r, r, m5);
+	mul_m4_m4m4(r, r, m6);
+	mul_m4_m4m4(r, r, m7);
+	mul_m4_m4m4(r, r, m8);
 }
 /** \} */




More information about the Bf-blender-cvs mailing list