diff options
Diffstat (limited to 'source/blender/blenlib/BLI_math_matrix.h')
-rw-r--r-- | source/blender/blenlib/BLI_math_matrix.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_math_matrix.h b/source/blender/blenlib/BLI_math_matrix.h index 03b6ff25a4f..1dcc1c1df49 100644 --- a/source/blender/blenlib/BLI_math_matrix.h +++ b/source/blender/blenlib/BLI_math_matrix.h @@ -431,6 +431,20 @@ void mat3_to_size(float size[3], const float M[3][3]); void mat4_to_size(float size[3], const float M[4][4]); /** + * Return the largest scale on any axis, the equivalent of calling: + * \code{.c} + * mat3_to_size(size_v3, mat); + * size = size_v3[max_axis_v3(size_v3)]; + * \endcode + * .. without 2x unnecessary `sqrtf` calls. + */ +float mat3_to_size_max_axis(const float M[3][3]); +/** + * Only the first 3 axes are used. + */ +float mat4_to_size_max_axis(const float M[4][4]); + +/** * Extract scale factors from the matrix, with correction to ensure * exact volume in case of a sheared matrix. */ |