[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [58178] trunk/blender/source/blender/ blenlib: utility function for printing arbitrary sizes vectors.

Campbell Barton ideasman42 at gmail.com
Thu Jul 11 17:32:26 CEST 2013


Revision: 58178
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=58178
Author:   campbellbarton
Date:     2013-07-11 15:32:26 +0000 (Thu, 11 Jul 2013)
Log Message:
-----------
utility function for printing arbitrary sizes vectors.

Modified Paths:
--------------
    trunk/blender/source/blender/blenlib/BLI_math_vector.h
    trunk/blender/source/blender/blenlib/intern/math_vector.c

Modified: trunk/blender/source/blender/blenlib/BLI_math_vector.h
===================================================================
--- trunk/blender/source/blender/blenlib/BLI_math_vector.h	2013-07-11 14:21:50 UTC (rev 58177)
+++ trunk/blender/source/blender/blenlib/BLI_math_vector.h	2013-07-11 15:32:26 UTC (rev 58178)
@@ -240,6 +240,7 @@
 void print_v2(const char *str, const float a[2]);
 void print_v3(const char *str, const float a[3]);
 void print_v4(const char *str, const float a[4]);
+void print_vn(const char *str, const float v[], const int n);
 
 MINLINE void normal_short_to_float_v3(float r[3], const short n[3]);
 MINLINE void normal_float_to_short_v3(short r[3], const float n[3]);

Modified: trunk/blender/source/blender/blenlib/intern/math_vector.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/math_vector.c	2013-07-11 14:21:50 UTC (rev 58177)
+++ trunk/blender/source/blender/blenlib/intern/math_vector.c	2013-07-11 15:32:26 UTC (rev 58178)
@@ -542,6 +542,16 @@
 	printf("%s: %.3f %.3f %.3f %.3f\n", str, v[0], v[1], v[2], v[3]);
 }
 
+void print_vn(const char *str, const float v[], const int n)
+{
+	int i = 0;
+	printf("%s[%d]:", str, n);
+	while (i++ < n) {
+		printf(" %.3f", v[i]);
+	}
+	printf("\n");
+}
+
 void minmax_v3v3_v3(float min[3], float max[3], const float vec[3])
 {
 	if (min[0] > vec[0]) min[0] = vec[0];




More information about the Bf-blender-cvs mailing list