diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-11-20 04:46:22 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-11-20 04:48:12 +0400 |
commit | 4c017090185f90f62eccd12c9f892964a4ffe93a (patch) | |
tree | 4891304a40b3925bd83390234d6746e019899799 /source/blender | |
parent | 02114a673787257dc93d151b8ea61844df9098e6 (diff) |
Math Library: add dot_m4_v3_row_x/y/z
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenlib/BLI_math_vector.h | 3 | ||||
-rw-r--r-- | source/blender/blenlib/intern/math_vector_inline.c | 16 |
2 files changed, 19 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_math_vector.h b/source/blender/blenlib/BLI_math_vector.h index 5a23e879b1a..3ff81e478c9 100644 --- a/source/blender/blenlib/BLI_math_vector.h +++ b/source/blender/blenlib/BLI_math_vector.h @@ -120,6 +120,9 @@ MINLINE float mul_project_m4_v3_zfac(float mat[4][4], const float co[3]) ATTR_WA MINLINE float dot_m3_v3_row_x(float M[3][3], const float a[3]) ATTR_WARN_UNUSED_RESULT; MINLINE float dot_m3_v3_row_y(float M[3][3], const float a[3]) ATTR_WARN_UNUSED_RESULT; MINLINE float dot_m3_v3_row_z(float M[3][3], const float a[3]) ATTR_WARN_UNUSED_RESULT; +MINLINE float dot_m4_v3_row_x(float M[4][4], const float a[3]) ATTR_WARN_UNUSED_RESULT; +MINLINE float dot_m4_v3_row_y(float M[4][4], const float a[3]) ATTR_WARN_UNUSED_RESULT; +MINLINE float dot_m4_v3_row_z(float M[4][4], const float a[3]) ATTR_WARN_UNUSED_RESULT; MINLINE void madd_v3_v3fl(float r[3], const float a[3], float f); MINLINE void madd_v3_v3v3(float r[3], const float a[3], const float b[3]); diff --git a/source/blender/blenlib/intern/math_vector_inline.c b/source/blender/blenlib/intern/math_vector_inline.c index 0ce5855b16a..ace8e6b48c1 100644 --- a/source/blender/blenlib/intern/math_vector_inline.c +++ b/source/blender/blenlib/intern/math_vector_inline.c @@ -450,6 +450,22 @@ MINLINE float dot_m3_v3_row_z(float M[3][3], const float a[3]) return M[0][2] * a[0] + M[1][2] * a[1] + M[2][2] * a[2]; } +/** + * Almost like mul_m4_v3(), misses adding translation. + */ +MINLINE float dot_m4_v3_row_x(float M[4][4], const float a[3]) +{ + return M[0][0] * a[0] + M[1][0] * a[1] + M[2][0] * a[2]; +} +MINLINE float dot_m4_v3_row_y(float M[4][4], const float a[3]) +{ + return M[0][1] * a[0] + M[1][1] * a[1] + M[2][1] * a[2]; +} +MINLINE float dot_m4_v3_row_z(float M[4][4], const float a[3]) +{ + return M[0][2] * a[0] + M[1][2] * a[1] + M[2][2] * a[2]; +} + MINLINE void madd_v2_v2fl(float r[2], const float a[2], float f) { r[0] += a[0] * f; |