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:
authorCampbell Barton <ideasman42@gmail.com>2014-05-29 18:26:05 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-05-29 18:26:32 +0400
commitb2cad79500bb1af92153928479ca7d7144463e00 (patch)
treee34b336625b2795a371eab7dcc0fc67588f74699 /source/blender/blenlib/intern/math_matrix.c
parent0780f5915b29ab7102bf1cb8bddd54774161d0d3 (diff)
Math lib: add negate_m3, negate_m4
Diffstat (limited to 'source/blender/blenlib/intern/math_matrix.c')
-rw-r--r--source/blender/blenlib/intern/math_matrix.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/source/blender/blenlib/intern/math_matrix.c b/source/blender/blenlib/intern/math_matrix.c
index f375a5c01ed..7fc30e3112b 100644
--- a/source/blender/blenlib/intern/math_matrix.c
+++ b/source/blender/blenlib/intern/math_matrix.c
@@ -519,7 +519,6 @@ void mul_transposed_mat3_m4_v3(float mat[4][4], float vec[3])
vec[2] = x * mat[2][0] + y * mat[2][1] + mat[2][2] * vec[2];
}
-
void mul_m3_fl(float m[3][3], float f)
{
int i, j;
@@ -547,6 +546,24 @@ void mul_mat3_m4_fl(float m[4][4], float f)
m[i][j] *= f;
}
+void negate_m3(float m[4][4])
+{
+ int i, j;
+
+ for (i = 0; i < 3; i++)
+ for (j = 0; j < 3; j++)
+ m[i][j] *= -1.0f;
+}
+
+void negate_m4(float m[4][4])
+{
+ int i, j;
+
+ for (i = 0; i < 4; i++)
+ for (j = 0; j < 4; j++)
+ m[i][j] *= -1.0f;
+}
+
void mul_m3_v3_double(float mat[3][3], double vec[3])
{
double x, y;