[Bf-blender-cvs] [4c01709] master: Math Library: add dot_m4_v3_row_x/y/z
Campbell Barton
noreply at git.blender.org
Wed Nov 20 01:49:27 CET 2013
Commit: 4c017090185f90f62eccd12c9f892964a4ffe93a
Author: Campbell Barton
Date: Wed Nov 20 11:46:22 2013 +1100
http://developer.blender.org/rB4c017090185f90f62eccd12c9f892964a4ffe93a
Math Library: add dot_m4_v3_row_x/y/z
===================================================================
M source/blender/blenlib/BLI_math_vector.h
M source/blender/blenlib/intern/math_vector_inline.c
===================================================================
diff --git a/source/blender/blenlib/BLI_math_vector.h b/source/blender/blenlib/BLI_math_vector.h
index 5a23e87..3ff81e4 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 0ce5855..ace8e6b 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;
More information about the Bf-blender-cvs
mailing list