From be72df4f06ac86f76d6dc4b5503531dbbdddce86 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Fri, 9 Oct 2015 20:57:37 +0200 Subject: 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. --- source/blender/blenlib/BLI_math_matrix.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source/blender/blenlib/BLI_math_matrix.h') 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]); -- cgit v1.2.3