diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-02-27 05:28:40 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-02-27 05:28:40 +0400 |
commit | b5d6f14290c02f17cce38e3f96594af76e0410ae (patch) | |
tree | 713c017a68f2b74b6b8a1ede041411bb44f74b58 /source/blender/blenlib/intern/math_rotation.c | |
parent | 26133a96ae82f44de12c4952ddca07578ede752c (diff) |
Fix T38858: Crazy spaces was unpredictable with co-linear edges
Diffstat (limited to 'source/blender/blenlib/intern/math_rotation.c')
-rw-r--r-- | source/blender/blenlib/intern/math_rotation.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/blenlib/intern/math_rotation.c b/source/blender/blenlib/intern/math_rotation.c index 0392598769f..c7c0626019f 100644 --- a/source/blender/blenlib/intern/math_rotation.c +++ b/source/blender/blenlib/intern/math_rotation.c @@ -663,11 +663,17 @@ void tri_to_quat_ex(float quat[4], const float v1[3], const float v2[3], const f mul_qt_qtqt(quat, q1, q2); } -void tri_to_quat(float quat[4], const float v1[3], const float v2[3], const float v3[3]) +/** + * \return the length of the normal, use to test for degenerate triangles. + */ +float tri_to_quat(float quat[4], const float v1[3], const float v2[3], const float v3[3]) { float vec[3]; - normal_tri_v3(vec, v1, v2, v3); + float len; + + len = normal_tri_v3(vec, v1, v2, v3); tri_to_quat_ex(quat, v1, v2, v3, vec); + return len; } void print_qt(const char *str, const float q[4]) |