diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2022-10-05 23:10:53 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2022-10-05 23:11:08 +0300 |
commit | 51bd26d0faad306183c58bff0865b72cf99fbe90 (patch) | |
tree | 1ce06c7f9d2679da81cb482ae96d8e9c6740ecc8 /source/blender/blenlib/BLI_math_matrix.h | |
parent | 1ff51f30ad8c3a93bd4f1f6aefa87a0b2c18efe3 (diff) |
New math function to add small bias to zero axis
In some situations the zero axis can produce problems and need to add a small bias.
This function adds a small bias using the orthogonal result of the others valid axis.
Reviewed By: fclem
Differential Revision: https://developer.blender.org/D16158
6d
Diffstat (limited to 'source/blender/blenlib/BLI_math_matrix.h')
-rw-r--r-- | source/blender/blenlib/BLI_math_matrix.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_math_matrix.h b/source/blender/blenlib/BLI_math_matrix.h index 19943614881..7e1b7c2ba56 100644 --- a/source/blender/blenlib/BLI_math_matrix.h +++ b/source/blender/blenlib/BLI_math_matrix.h @@ -367,6 +367,8 @@ void pseudoinverse_m4_m4(float inverse[4][4], const float mat[4][4], float epsil void pseudoinverse_m3_m3(float inverse[3][3], const float mat[3][3], float epsilon); bool has_zero_axis_m4(const float matrix[4][4]); +/** Fix any zero scale axis adding a small bias orthogonal to the other valid axis. */ +void zero_axis_bias_m4(float mat[4][4]); void invert_m4_m4_safe(float inverse[4][4], const float mat[4][4]); |