diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2015-10-09 21:57:37 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2015-10-09 22:26:33 +0300 |
commit | be72df4f06ac86f76d6dc4b5503531dbbdddce86 (patch) | |
tree | 03759124917382ab074a9dfc547533e191aa0ae3 /source/blender/blenlib/BLI_math_matrix.h | |
parent | 8159718fafc57cfbc9da7f706e599a91caccfa42 (diff) |
BLI_math: add mat3_polar_decompose, interp_m3_m3m3 and interp_m4_m4m4.
mat3_polar_decompose gives the right polar decomposition of given matrix,
as a pair (U, P) of matrices.
interp_m3_m3m3 uses that polar decomposition to perform a correct matrix interpolation,
even with non-uniformly scaled ones (where blend_m3_m3m3 would fail).
interp_m4_m4m4 just adds translation interpolation to the _m3 variant.
Diffstat (limited to 'source/blender/blenlib/BLI_math_matrix.h')
-rw-r--r-- | source/blender/blenlib/BLI_math_matrix.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_math_matrix.h b/source/blender/blenlib/BLI_math_matrix.h index d7a309e0835..80a399ac6d7 100644 --- a/source/blender/blenlib/BLI_math_matrix.h +++ b/source/blender/blenlib/BLI_math_matrix.h @@ -215,6 +215,8 @@ void mat4_to_loc_rot_size(float loc[3], float rot[3][3], float size[3], float wm void mat4_to_loc_quat(float loc[3], float quat[4], float wmat[4][4]); void mat4_decompose(float loc[3], float quat[4], float size[3], float wmat[4][4]); +void mat3_polar_decompose(float mat3[3][3], float r_U[3][3], float r_P[3][3]); + void loc_eul_size_to_mat4(float R[4][4], const float loc[3], const float eul[3], const float size[3]); void loc_eulO_size_to_mat4(float R[4][4], @@ -227,6 +229,9 @@ void loc_axisangle_size_to_mat4(float R[4][4], void blend_m3_m3m3(float R[3][3], float A[3][3], float B[3][3], const float t); void blend_m4_m4m4(float R[4][4], float A[4][4], float B[4][4], const float t); +void interp_m3_m3m3(float R[3][3], float A[3][3], float B[3][3], const float t); +void interp_m4_m4m4(float R[4][4], float A[4][4], float B[4][4], const float t); + bool is_negative_m3(float mat[3][3]); bool is_negative_m4(float mat[4][4]); |