diff options
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/BLI_math_matrix.h | 1 | ||||
-rw-r--r-- | source/blender/blenlib/intern/math_matrix.c | 11 |
2 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_math_matrix.h b/source/blender/blenlib/BLI_math_matrix.h index 65d654bc930..03b6ff25a4f 100644 --- a/source/blender/blenlib/BLI_math_matrix.h +++ b/source/blender/blenlib/BLI_math_matrix.h @@ -404,6 +404,7 @@ void invert_m4_m4_safe_ortho(float Ainv[4][4], const float A[4][4]); void scale_m3_fl(float R[3][3], float scale); void scale_m4_fl(float R[4][4], float scale); +void scale_m4_v2(float R[4][4], const float scale[2]); /** * This computes the overall volume scale factor of a transformation matrix. diff --git a/source/blender/blenlib/intern/math_matrix.c b/source/blender/blenlib/intern/math_matrix.c index eaf76696a0a..f307672361b 100644 --- a/source/blender/blenlib/intern/math_matrix.c +++ b/source/blender/blenlib/intern/math_matrix.c @@ -2296,6 +2296,17 @@ void scale_m4_fl(float R[4][4], float scale) R[3][0] = R[3][1] = R[3][2] = 0.0; } +void scale_m4_v2(float R[4][4], const float scale[2]) +{ + R[0][0] = scale[0]; + R[1][1] = scale[1]; + R[2][2] = R[3][3] = 1.0; + R[0][1] = R[0][2] = R[0][3] = 0.0; + R[1][0] = R[1][2] = R[1][3] = 0.0; + R[2][0] = R[2][1] = R[2][3] = 0.0; + R[3][0] = R[3][1] = R[3][2] = 0.0; +} + void translate_m4(float mat[4][4], float Tx, float Ty, float Tz) { mat[3][0] += (Tx * mat[0][0] + Ty * mat[1][0] + Tz * mat[2][0]); |