From 071a43f7540cbb263d3b974203c4c2cb0757464c Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 14 Dec 2012 21:41:22 +0000 Subject: Fix #33497: seting object scale to 0 on one axis made moving verts in edit mode impossible. In this case matrix inversion failed and didn't give a useful result. Now it falls back to a pseudoinverse in that case, so that moving along the other axes still works. There may be other places that can benefit from this, but this is a place where it has no significant performance impact, doing this in general for e.g. bone matrices could be quite slow. --- source/blender/blenlib/BLI_math_matrix.h | 4 ++++ 1 file changed, 4 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 c97eb4c588c..c12ec62ca1b 100644 --- a/source/blender/blenlib/BLI_math_matrix.h +++ b/source/blender/blenlib/BLI_math_matrix.h @@ -144,10 +144,14 @@ float determinant_m2(float a, float b, float determinant_m3(float a, float b, float c, float d, float e, float f, float g, float h, float i); +float determinant_m3_array(float m[3][3]); float determinant_m4(float A[4][4]); +#define PSEUDOINVERSE_EPSILON 1e-8f + void svd_m4(float U[4][4], float s[4], float V[4][4], float A[4][4]); void pseudoinverse_m4_m4(float Ainv[4][4], float A[4][4], float epsilon); +void pseudoinverse_m3_m3(float Ainv[3][3], float A[3][3], float epsilon); /****************************** Transformations ******************************/ -- cgit v1.2.3