diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-01-29 19:05:23 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-01-29 19:05:23 +0400 |
commit | 2b875a947ff831dd8f7d4b5bc2d5df10f614864d (patch) | |
tree | 768be65da6d7433515bb17a4e2897c1ed30b32ef /source/blender/blenlib/intern | |
parent | d18fca88b9b292631b02fe98055372d4746866c3 (diff) |
skip calculating the normal for each face when triangulating, all callers make sure its valid. also remove some commented code (more then one generation of bmesh old).
Diffstat (limited to 'source/blender/blenlib/intern')
-rw-r--r-- | source/blender/blenlib/intern/math_matrix.c | 7 | ||||
-rw-r--r-- | source/blender/blenlib/intern/math_rotation.c | 2 |
2 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/math_matrix.c b/source/blender/blenlib/intern/math_matrix.c index 8f9ea917b8c..b7e7fea897f 100644 --- a/source/blender/blenlib/intern/math_matrix.c +++ b/source/blender/blenlib/intern/math_matrix.c @@ -411,6 +411,13 @@ void mul_v3_m3v3(float r[3], float M[3][3], float a[3]) r[2] = M[0][2] * a[0] + M[1][2] * a[1] + M[2][2] * a[2]; } +void mul_v2_m3v3(float r[2], float M[3][3], float a[3]) +{ + r[0] = M[0][0] * a[0] + M[1][0] * a[1] + M[2][0] * a[2]; + r[1] = M[0][1] * a[0] + M[1][1] * a[1] + M[2][1] * a[2]; + r[2] = M[0][2] * a[0] + M[1][2] * a[1] + M[2][2] * a[2]; +} + void mul_m3_v3(float M[3][3], float r[3]) { float tmp[3]; diff --git a/source/blender/blenlib/intern/math_rotation.c b/source/blender/blenlib/intern/math_rotation.c index b38b5a2de10..e6399ed356e 100644 --- a/source/blender/blenlib/intern/math_rotation.c +++ b/source/blender/blenlib/intern/math_rotation.c @@ -84,6 +84,8 @@ void mul_qt_qtqt(float q[4], const float q1[4], const float q2[4]) * \note: * Assumes a unit quaternion? * + * \note: multiplying by 3x3 matrix is ~25% faster. + * * in fact not, but you may want to use a unit quat, read on... * * Shortcut for 'q v q*' when \a v is actually a quaternion. |