diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-07-21 12:55:12 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-07-21 12:57:35 +0400 |
commit | 8489b94e07f9e73bd3c9c3e4f6a91f1f0a259827 (patch) | |
tree | c19fb4ce9919c44876fee88c143ead4722603ca5 /source/blender/blenlib | |
parent | 1fdaf5862feab049d6e8e60cd5f1469a17b9cda5 (diff) |
Math Lib: rename mul_serie_m3 to mul_m3_series & reorder args
Importantly, reversed mul_serie_m3 argument order (so it matches the m4 function)
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/BLI_math_matrix.h | 52 | ||||
-rw-r--r-- | source/blender/blenlib/intern/math_matrix.c | 90 | ||||
-rw-r--r-- | source/blender/blenlib/intern/math_rotation.c | 2 |
3 files changed, 72 insertions, 72 deletions
diff --git a/source/blender/blenlib/BLI_math_matrix.h b/source/blender/blenlib/BLI_math_matrix.h index 1c1e4e7eb3f..68d8e3b9499 100644 --- a/source/blender/blenlib/BLI_math_matrix.h +++ b/source/blender/blenlib/BLI_math_matrix.h @@ -69,33 +69,33 @@ void mul_m4_m4m3(float R[4][4], float A[4][4], float B[3][3]); void mul_m4_m4m4(float R[4][4], float A[4][4], float B[4][4]); void mul_m3_m3m4(float R[3][3], float A[4][4], float B[3][3]); -/* mul_serie_m3 */ -void _va_mul_serie_m3_3(float R[3][3], float M1[3][3], float M2[3][3]) ATTR_NONNULL(); -void _va_mul_serie_m3_4(float R[3][3], float M1[3][3], float M2[3][3], float M3[3][3]) ATTR_NONNULL(); -void _va_mul_serie_m3_5(float R[3][3], float M1[3][3], float M2[3][3], float M3[3][3], float M4[3][3]) ATTR_NONNULL(); -void _va_mul_serie_m3_6(float R[3][3], float M1[3][3], float M2[3][3], float M3[3][3], float M4[3][3], - float M5[3][3]) ATTR_NONNULL(); -void _va_mul_serie_m3_7(float R[3][3], float M1[3][3], float M2[3][3], float M3[3][3], float M4[3][3], - float M5[3][3], float M6[3][3]) ATTR_NONNULL(); -void _va_mul_serie_m3_8(float R[3][3], float M1[3][3], float M2[3][3], float M3[3][3], float M4[3][3], - float M5[3][3], float M6[3][3], float M7[3][3]) ATTR_NONNULL(); -void _va_mul_serie_m3_9(float R[3][3], float M1[3][3], float M2[3][3], float M3[3][3], float M4[3][3], - float M5[3][3], float M6[3][3], float M7[3][3], float M8[3][3]) ATTR_NONNULL(); -/* mul_serie_m4 */ -void _va_mul_serie_m4_3(float R[4][4], float M1[4][4], float M2[4][4]) ATTR_NONNULL(); -void _va_mul_serie_m4_4(float R[4][4], float M1[4][4], float M2[4][4], float M3[4][4]) ATTR_NONNULL(); -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]) ATTR_NONNULL(); -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], +/* mul_m3_series */ +void _va_mul_m3_series_3(float R[3][3], float M1[3][3], float M2[3][3]) ATTR_NONNULL(); +void _va_mul_m3_series_4(float R[3][3], float M1[3][3], float M2[3][3], float M3[3][3]) ATTR_NONNULL(); +void _va_mul_m3_series_5(float R[3][3], float M1[3][3], float M2[3][3], float M3[3][3], float M4[3][3]) ATTR_NONNULL(); +void _va_mul_m3_series_6(float R[3][3], float M1[3][3], float M2[3][3], float M3[3][3], float M4[3][3], + float M5[3][3]) ATTR_NONNULL(); +void _va_mul_m3_series_7(float R[3][3], float M1[3][3], float M2[3][3], float M3[3][3], float M4[3][3], + float M5[3][3], float M6[3][3]) ATTR_NONNULL(); +void _va_mul_m3_series_8(float R[3][3], float M1[3][3], float M2[3][3], float M3[3][3], float M4[3][3], + float M5[3][3], float M6[3][3], float M7[3][3]) ATTR_NONNULL(); +void _va_mul_m3_series_9(float R[3][3], float M1[3][3], float M2[3][3], float M3[3][3], float M4[3][3], + float M5[3][3], float M6[3][3], float M7[3][3], float M8[3][3]) ATTR_NONNULL(); +/* mul_m4_series */ +void _va_mul_m4_series_3(float R[4][4], float M1[4][4], float M2[4][4]) ATTR_NONNULL(); +void _va_mul_m4_series_4(float R[4][4], float M1[4][4], float M2[4][4], float M3[4][4]) ATTR_NONNULL(); +void _va_mul_m4_series_5(float R[4][4], float M1[4][4], float M2[4][4], float M3[4][4], float M4[4][4]) ATTR_NONNULL(); +void _va_mul_m4_series_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]) ATTR_NONNULL(); -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]) ATTR_NONNULL(); -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]) ATTR_NONNULL(); -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]) ATTR_NONNULL(); - -#define mul_serie_m3(...) VA_NARGS_CALL_OVERLOAD(_va_mul_serie_m3_, __VA_ARGS__) -#define mul_serie_m4(...) VA_NARGS_CALL_OVERLOAD(_va_mul_serie_m4_, __VA_ARGS__) +void _va_mul_m4_series_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]) ATTR_NONNULL(); +void _va_mul_m4_series_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]) ATTR_NONNULL(); +void _va_mul_m4_series_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]) ATTR_NONNULL(); + +#define mul_m3_series(...) VA_NARGS_CALL_OVERLOAD(_va_mul_m3_series_, __VA_ARGS__) +#define mul_m4_series(...) VA_NARGS_CALL_OVERLOAD(_va_mul_m4_series_, __VA_ARGS__) void mul_m4_v3(float M[4][4], float r[3]); void mul_v3_m4v3(float r[3], float M[4][4], const float v[3]); diff --git a/source/blender/blenlib/intern/math_matrix.c b/source/blender/blenlib/intern/math_matrix.c index 1a4beab34da..bc39150b767 100644 --- a/source/blender/blenlib/intern/math_matrix.c +++ b/source/blender/blenlib/intern/math_matrix.c @@ -275,93 +275,93 @@ void mul_m4_m3m4(float m1[4][4], float m3_[3][3], float m2_[4][4]) } -/** \name Macro helpers for: mul_serie_m3 +/** \name Macro helpers for: mul_m3_series * \{ */ -void _va_mul_serie_m3_3( +void _va_mul_m3_series_3( float r[3][3], float m1[3][3], float m2[3][3]) { - mul_m3_m3m3(r, m2, m1); + mul_m3_m3m3(r, m1, m2); } -void _va_mul_serie_m3_4( +void _va_mul_m3_series_4( float r[3][3], float m1[3][3], float m2[3][3], float m3[3][3]) { - mul_m3_m3m3(r, m2, m1); - mul_m3_m3m3(r, m3, r); + mul_m3_m3m3(r, m1, m2); + mul_m3_m3m3(r, r, m3); } -void _va_mul_serie_m3_5( +void _va_mul_m3_series_5( float r[3][3], float m1[3][3], float m2[3][3], float m3[3][3], float m4[3][3]) { - mul_m3_m3m3(r, m2, m1); - mul_m3_m3m3(r, m3, r); - mul_m3_m3m3(r, m4, r); + mul_m3_m3m3(r, m1, m2); + mul_m3_m3m3(r, r, m3); + mul_m3_m3m3(r, r, m4); } -void _va_mul_serie_m3_6( +void _va_mul_m3_series_6( float r[3][3], float m1[3][3], float m2[3][3], float m3[3][3], float m4[3][3], float m5[3][3]) { - mul_m3_m3m3(r, m2, m1); - mul_m3_m3m3(r, m3, r); - mul_m3_m3m3(r, m4, r); - mul_m3_m3m3(r, m5, r); + mul_m3_m3m3(r, m1, m2); + mul_m3_m3m3(r, r, m3); + mul_m3_m3m3(r, r, m4); + mul_m3_m3m3(r, r, m5); } -void _va_mul_serie_m3_7( +void _va_mul_m3_series_7( float r[3][3], float m1[3][3], float m2[3][3], float m3[3][3], float m4[3][3], float m5[3][3], float m6[3][3]) { - mul_m3_m3m3(r, m2, m1); - mul_m3_m3m3(r, m3, r); - mul_m3_m3m3(r, m4, r); - mul_m3_m3m3(r, m5, r); - mul_m3_m3m3(r, m6, r); + mul_m3_m3m3(r, m1, m2); + mul_m3_m3m3(r, r, m3); + mul_m3_m3m3(r, r, m4); + mul_m3_m3m3(r, r, m5); + mul_m3_m3m3(r, r, m6); } -void _va_mul_serie_m3_8( +void _va_mul_m3_series_8( float r[3][3], float m1[3][3], float m2[3][3], float m3[3][3], float m4[3][3], float m5[3][3], float m6[3][3], float m7[3][3]) { - mul_m3_m3m3(r, m2, m1); - mul_m3_m3m3(r, m3, r); - mul_m3_m3m3(r, m4, r); - mul_m3_m3m3(r, m5, r); - mul_m3_m3m3(r, m6, r); - mul_m3_m3m3(r, m7, r); + mul_m3_m3m3(r, m1, m2); + mul_m3_m3m3(r, r, m3); + mul_m3_m3m3(r, r, m4); + mul_m3_m3m3(r, r, m5); + mul_m3_m3m3(r, r, m6); + mul_m3_m3m3(r, r, m7); } -void _va_mul_serie_m3_9( +void _va_mul_m3_series_9( float r[3][3], float m1[3][3], float m2[3][3], float m3[3][3], float m4[3][3], float m5[3][3], float m6[3][3], float m7[3][3], float m8[3][3]) { - mul_m3_m3m3(r, m2, m1); - mul_m3_m3m3(r, m3, r); - mul_m3_m3m3(r, m4, r); - mul_m3_m3m3(r, m5, r); - mul_m3_m3m3(r, m6, r); - mul_m3_m3m3(r, m7, r); - mul_m3_m3m3(r, m8, r); + mul_m3_m3m3(r, m1, m2); + mul_m3_m3m3(r, r, m3); + mul_m3_m3m3(r, r, m4); + mul_m3_m3m3(r, r, m5); + mul_m3_m3m3(r, r, m6); + mul_m3_m3m3(r, r, m7); + mul_m3_m3m3(r, r, m8); } /** \} */ -/** \name Macro helpers for: mul_serie_m4 +/** \name Macro helpers for: mul_m4_series * \{ */ -void _va_mul_serie_m4_3( +void _va_mul_m4_series_3( float r[4][4], float m1[4][4], float m2[4][4]) { mul_m4_m4m4(r, m1, m2); } -void _va_mul_serie_m4_4( +void _va_mul_m4_series_4( float r[4][4], float m1[4][4], float m2[4][4], float m3[4][4]) { mul_m4_m4m4(r, m1, m2); mul_m4_m4m4(r, r, m3); } -void _va_mul_serie_m4_5( +void _va_mul_m4_series_5( float r[4][4], float m1[4][4], float m2[4][4], float m3[4][4], float m4[4][4]) { @@ -369,7 +369,7 @@ void _va_mul_serie_m4_5( mul_m4_m4m4(r, r, m3); mul_m4_m4m4(r, r, m4); } -void _va_mul_serie_m4_6( +void _va_mul_m4_series_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]) @@ -379,7 +379,7 @@ void _va_mul_serie_m4_6( mul_m4_m4m4(r, r, m4); mul_m4_m4m4(r, r, m5); } -void _va_mul_serie_m4_7( +void _va_mul_m4_series_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]) @@ -390,7 +390,7 @@ void _va_mul_serie_m4_7( mul_m4_m4m4(r, r, m5); mul_m4_m4m4(r, r, m6); } -void _va_mul_serie_m4_8( +void _va_mul_m4_series_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]) @@ -402,7 +402,7 @@ void _va_mul_serie_m4_8( mul_m4_m4m4(r, r, m6); mul_m4_m4m4(r, r, m7); } -void _va_mul_serie_m4_9( +void _va_mul_m4_series_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]) @@ -2192,7 +2192,7 @@ void pseudoinverse_m4_m4(float Ainv[4][4], float A[4][4], float epsilon) transpose_m4(V); - mul_serie_m4(Ainv, U, Wm, V); + mul_m4_series(Ainv, U, Wm, V); } void pseudoinverse_m3_m3(float Ainv[3][3], float A[3][3], float epsilon) diff --git a/source/blender/blenlib/intern/math_rotation.c b/source/blender/blenlib/intern/math_rotation.c index b1db6ef9f2b..df3c4fb8336 100644 --- a/source/blender/blenlib/intern/math_rotation.c +++ b/source/blender/blenlib/intern/math_rotation.c @@ -1606,7 +1606,7 @@ void mat4_to_dquat(DualQuat *dq, float basemat[4][4], float mat[4][4]) mul_m4_m4m4(S, baseRinv, baseRS); /* set scaling part */ - mul_serie_m4(dq->scale, basemat, S, baseinv); + mul_m4_series(dq->scale, basemat, S, baseinv); dq->scale_weight = 1.0f; } else { |