Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-11-28 16:11:41 +0300
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-11-28 16:11:41 +0300
commitb83751d8c2a3fd85e6e8e301ee1f986d684b03d5 (patch)
tree90fa40753996ef32fe9986f509ed5ff01aba3dbc /source/blender/blenlib/intern/math_matrix.c
parent9094f2072e2e9c3d67c62058e21ee103d5726f37 (diff)
Math Lib: merging over some changes from the sculpt branch:
* swap v2/v3 * multiply-and-add (madd) v3 * inline v3 short/float conversion * mul_v3_m3v3
Diffstat (limited to 'source/blender/blenlib/intern/math_matrix.c')
-rw-r--r--source/blender/blenlib/intern/math_matrix.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/source/blender/blenlib/intern/math_matrix.c b/source/blender/blenlib/intern/math_matrix.c
index edab1cc2440..47b99bce8ab 100644
--- a/source/blender/blenlib/intern/math_matrix.c
+++ b/source/blender/blenlib/intern/math_matrix.c
@@ -338,15 +338,19 @@ void mul_m4_v4(float mat[][4], float *vec)
vec[3]=x*mat[0][3] + y*mat[1][3] + z*mat[2][3] + mat[3][3]*vec[3];
}
-void mul_m3_v3(float mat[][3], float *vec)
+void mul_v3_m3v3(float r[3], float M[3][3], float a[3])
{
- float x,y;
+ 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];
+}
- x=vec[0];
- y=vec[1];
- vec[0]= x*mat[0][0] + y*mat[1][0] + mat[2][0]*vec[2];
- vec[1]= x*mat[0][1] + y*mat[1][1] + mat[2][1]*vec[2];
- vec[2]= x*mat[0][2] + y*mat[1][2] + mat[2][2]*vec[2];
+void mul_m3_v3(float M[3][3], float r[3])
+{
+ float tmp[3];
+
+ mul_v3_m3v3(tmp, M, r);
+ copy_v3_v3(r, tmp);
}
void mul_transposed_m3_v3(float mat[][3], float *vec)