diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2013-02-12 02:52:13 +0400 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2013-02-12 02:52:13 +0400 |
commit | fcbd9c3a332fda86c2fe9e8cf5ddfacf29b85419 (patch) | |
tree | 77140f7f3d3c0f3f714068212ac3966a8b5690c1 /source/blender/blenlib/intern/math_matrix.c | |
parent | eb9c3f6aecc982a7377574866110018ca8eb744f (diff) |
Old bug fix: Uv smart stitch failed to detect angle if islands were
rotated close to 180 degrees and there were edges both below and above
the 180 degree threshhold. Separating and averaging the negative and
positive angles seems to solve the issue making the tool a bit more
robust ;)
Diffstat (limited to 'source/blender/blenlib/intern/math_matrix.c')
-rw-r--r-- | source/blender/blenlib/intern/math_matrix.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/math_matrix.c b/source/blender/blenlib/intern/math_matrix.c index 5c443b9b1f3..c12588463b0 100644 --- a/source/blender/blenlib/intern/math_matrix.c +++ b/source/blender/blenlib/intern/math_matrix.c @@ -344,6 +344,12 @@ void mul_v3_m4v3(float in[3], float mat[4][4], const float vec[3]) in[2] = x * mat[0][2] + y * mat[1][2] + mat[2][2] * vec[2] + mat[3][2]; } +void mul_v2_m2v2(float r[2], float M[2][2], const float v[2]) +{ + r[0] = M[0][0]*v[0] + M[1][0]*v[1]; + r[1] = M[0][1]*v[0] + M[1][1]*v[1]; +} + /* same as mul_m4_v3() but doesnt apply translation component */ void mul_mat3_m4_v3(float mat[4][4], float vec[3]) { @@ -1304,6 +1310,13 @@ void rotate_m4(float mat[4][4], const char axis, const float angle) } } +void rotate_m2(float mat[2][2], const float angle) +{ + mat[0][0] = mat[1][1] = cosf(angle); + mat[0][1] = sinf(angle); + mat[1][0] = -mat[0][1]; +} + void blend_m3_m3m3(float out[3][3], float dst[3][3], float src[3][3], const float srcweight) { float srot[3][3], drot[3][3]; |