[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [60851] trunk/blender/source/blender: Move utility functions from mball to mathutils

Sergey Sharybin sergey.vfx at gmail.com
Sat Oct 19 01:38:52 CEST 2013


Revision: 60851
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=60851
Author:   nazgul
Date:     2013-10-18 23:38:51 +0000 (Fri, 18 Oct 2013)
Log Message:
-----------
Move utility functions from mball to mathutils

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/mball.c
    trunk/blender/source/blender/blenlib/BLI_math_matrix.h
    trunk/blender/source/blender/blenlib/BLI_math_vector.h
    trunk/blender/source/blender/blenlib/intern/math_matrix.c
    trunk/blender/source/blender/blenlib/intern/math_vector_inline.c

Modified: trunk/blender/source/blender/blenkernel/intern/mball.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/mball.c	2013-10-18 23:18:40 UTC (rev 60850)
+++ trunk/blender/source/blender/blenkernel/intern/mball.c	2013-10-18 23:38:51 UTC (rev 60851)
@@ -1637,22 +1637,6 @@
 	}
 }
 
-/* could move to math api */
-BLI_INLINE void copy_v3_fl3(float v[3], float x, float y, float z)
-{
-	v[0] = x;
-	v[1] = y;
-	v[2] = z;
-}
-
-/* TODO(sergey): Perhaps it could be general utility function in mathutils. */
-static bool has_zero_axis_m4(float matrix[4][4])
-{
-	return len_squared_v3(matrix[0]) < FLT_EPSILON ||
-	       len_squared_v3(matrix[1]) < FLT_EPSILON ||
-	       len_squared_v3(matrix[2]) < FLT_EPSILON;
-}
-
 static float init_meta(PROCESS *process, Scene *scene, Object *ob)    /* return totsize */
 {
 	Scene *sce_iter = scene;

Modified: trunk/blender/source/blender/blenlib/BLI_math_matrix.h
===================================================================
--- trunk/blender/source/blender/blenlib/BLI_math_matrix.h	2013-10-18 23:18:40 UTC (rev 60850)
+++ trunk/blender/source/blender/blenlib/BLI_math_matrix.h	2013-10-18 23:38:51 UTC (rev 60851)
@@ -160,6 +160,8 @@
 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);
 
+bool has_zero_axis_m4(float matrix[4][4]);
+
 /****************************** Transformations ******************************/
 
 void scale_m3_fl(float R[3][3], float scale);

Modified: trunk/blender/source/blender/blenlib/BLI_math_vector.h
===================================================================
--- trunk/blender/source/blender/blenlib/BLI_math_vector.h	2013-10-18 23:18:40 UTC (rev 60850)
+++ trunk/blender/source/blender/blenlib/BLI_math_vector.h	2013-10-18 23:38:51 UTC (rev 60851)
@@ -82,6 +82,8 @@
 MINLINE void copy_v2db_v2fl(double r[2], const float a[2]);
 MINLINE void copy_v3db_v3fl(double r[3], const float a[3]);
 MINLINE void copy_v4db_v4fl(double r[4], const float a[4]);
+/* 3 float -> vec */
+MINLINE void copy_v3_fl3(float v[3], float x, float y, float z);
 
 /********************************* Arithmetic ********************************/
 

Modified: trunk/blender/source/blender/blenlib/intern/math_matrix.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/math_matrix.c	2013-10-18 23:18:40 UTC (rev 60850)
+++ trunk/blender/source/blender/blenlib/intern/math_matrix.c	2013-10-18 23:38:51 UTC (rev 60851)
@@ -2070,3 +2070,9 @@
 	}
 }
 
+bool has_zero_axis_m4(float matrix[4][4])
+{
+	return len_squared_v3(matrix[0]) < FLT_EPSILON ||
+	       len_squared_v3(matrix[1]) < FLT_EPSILON ||
+	       len_squared_v3(matrix[2]) < FLT_EPSILON;
+}

Modified: trunk/blender/source/blender/blenlib/intern/math_vector_inline.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/math_vector_inline.c	2013-10-18 23:18:40 UTC (rev 60850)
+++ trunk/blender/source/blender/blenlib/intern/math_vector_inline.c	2013-10-18 23:38:51 UTC (rev 60851)
@@ -235,6 +235,14 @@
 	SWAP(float, a[3], b[3]);
 }
 
+/* 3 float -> vec */
+MINLINE void copy_v3_fl3(float v[3], float x, float y, float z)
+{
+	v[0] = x;
+	v[1] = y;
+	v[2] = z;
+}
+
 /********************************* Arithmetic ********************************/
 
 MINLINE void add_v2_fl(float r[2], float f)




More information about the Bf-blender-cvs mailing list