diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-09-11 14:06:54 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-09-11 14:06:54 +0400 |
commit | 9b09af0dca5619c9dfc95f5012d3f684f59b39a9 (patch) | |
tree | 65e88948e953f5f00c7b62c6705ac37464c52abe /source/blender/blenlib | |
parent | 441bb19357a840fa9ba93565d0f3dc42a054ddbd (diff) |
Fix #36701: Mask pivioting doesnt honor parenting
Made mask transformation aware of parent matrix.
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/BLI_math_matrix.h | 2 | ||||
-rw-r--r-- | source/blender/blenlib/intern/math_matrix.c | 18 |
2 files changed, 20 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_math_matrix.h b/source/blender/blenlib/BLI_math_matrix.h index c305cc9a030..b04af44156f 100644 --- a/source/blender/blenlib/BLI_math_matrix.h +++ b/source/blender/blenlib/BLI_math_matrix.h @@ -94,6 +94,8 @@ void mul_v4_m4v4(float r[4], float M[4][4], const float v[4]); void mul_project_m4_v3(float M[4][4], float vec[3]); void mul_v2_project_m4_v3(float r[2], float M[4][4], const float vec[3]); +void mul_m3_v2(float m[3][3], float r[2]); +void mul_v2_m3v2(float r[2], float m[3][3], float v[2]); void mul_m3_v3(float M[3][3], float r[3]); void mul_v3_m3v3(float r[3], float M[3][3], const float a[3]); void mul_v2_m3v3(float r[2], float M[3][3], const float a[3]); diff --git a/source/blender/blenlib/intern/math_matrix.c b/source/blender/blenlib/intern/math_matrix.c index 611b3298c38..d24200fc0b7 100644 --- a/source/blender/blenlib/intern/math_matrix.c +++ b/source/blender/blenlib/intern/math_matrix.c @@ -322,6 +322,24 @@ void mul_serie_m4(float answ[4][4], float m1[4][4], } } +void mul_v2_m3v2(float r[2], float m[3][3], float v[2]) +{ + float temp[3], warped[3]; + + copy_v2_v2(temp, v); + temp[2] = 1.0f; + + mul_v3_m3v3(warped, m, temp); + + r[0] = warped[0] / warped[2]; + r[1] = warped[1] / warped[2]; +} + +void mul_m3_v2(float m[3][3], float r[2]) +{ + mul_v2_m3v2(r, m, r); +} + void mul_m4_v3(float mat[4][4], float vec[3]) { float x, y; |