[Bf-blender-cvs] [6f779218fb6] blender-v2.81-release: BLI_math: support MATH_STANDALONE without Eigen
Campbell Barton
noreply at git.blender.org
Tue Oct 22 06:25:47 CEST 2019
Commit: 6f779218fb6d04d5493cf8aff6884ebe18ffdc1e
Author: Campbell Barton
Date: Tue Oct 22 15:21:59 2019 +1100
Branches: blender-v2.81-release
https://developer.blender.org/rB6f779218fb6d04d5493cf8aff6884ebe18ffdc1e
BLI_math: support MATH_STANDALONE without Eigen
===================================================================
M source/blender/blenlib/intern/math_matrix.c
===================================================================
diff --git a/source/blender/blenlib/intern/math_matrix.c b/source/blender/blenlib/intern/math_matrix.c
index 33e272ed7eb..48884082dd8 100644
--- a/source/blender/blenlib/intern/math_matrix.c
+++ b/source/blender/blenlib/intern/math_matrix.c
@@ -28,7 +28,9 @@
#include "BLI_strict_flags.h"
-#include "eigen_capi.h"
+#ifndef MATH_STANDALONE
+# include "eigen_capi.h"
+#endif
/********************************* Init **************************************/
@@ -1152,9 +1154,11 @@ bool invert_m4(float m[4][4])
*/
bool invert_m4_m4_fallback(float inverse[4][4], const float mat[4][4])
{
+#ifndef MATH_STANDALONE
if (EIG_invert_m4_m4(inverse, mat)) {
return true;
}
+#endif
int i, j, k;
double temp;
@@ -1222,9 +1226,13 @@ bool invert_m4_m4_fallback(float inverse[4][4], const float mat[4][4])
bool invert_m4_m4(float inverse[4][4], const float mat[4][4])
{
+#ifndef MATH_STANDALONE
/* Use optimized matrix inverse from Eigen, since performance
* impact of this function is significant in complex rigs. */
return EIG_invert_m4_m4(inverse, mat);
+#else
+ return invert_m4_m4_fallback(inverse, mat);
+#endif
}
/****************************** Linear Algebra *******************************/
More information about the Bf-blender-cvs
mailing list