[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [44201] trunk/blender/source/blender: add note to avoid confusion with angle_v3v3v3, also minor change with angle comparison, convert constant values to radians (not resulting angle to deg).

Campbell Barton ideasman42 at gmail.com
Fri Feb 17 18:47:11 CET 2012


Revision: 44201
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=44201
Author:   campbellbarton
Date:     2012-02-17 17:47:10 +0000 (Fri, 17 Feb 2012)
Log Message:
-----------
add note to avoid confusion with angle_v3v3v3, also minor change with angle comparison, convert constant values to radians (not resulting angle to deg).

Modified Paths:
--------------
    trunk/blender/source/blender/blenlib/intern/math_vector.c
    trunk/blender/source/blender/editors/armature/meshlaplacian.c

Modified: trunk/blender/source/blender/blenlib/intern/math_vector.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/math_vector.c	2012-02-17 17:34:16 UTC (rev 44200)
+++ trunk/blender/source/blender/blenlib/intern/math_vector.c	2012-02-17 17:47:10 UTC (rev 44201)
@@ -112,8 +112,12 @@
 /********************************** Angles ***********************************/
 
 /* Return the angle in radians between vecs 1-2 and 2-3 in radians
-   If v1 is a shoulder, v2 is the elbow and v3 is the hand,
-   this would return the angle at the elbow */
+ * If v1 is a shoulder, v2 is the elbow and v3 is the hand,
+ * this would return the angle at the elbow.
+ *
+ * note that when v1/v2/v3 represent 3 points along a straight line
+ * that the angle returned will be pi (180deg), rather then 0.0
+ */
 float angle_v3v3v3(const float v1[3], const float v2[3], const float v3[3])
 {
 	float vec1[3], vec2[3];

Modified: trunk/blender/source/blender/editors/armature/meshlaplacian.c
===================================================================
--- trunk/blender/source/blender/editors/armature/meshlaplacian.c	2012-02-17 17:34:16 UTC (rev 44200)
+++ trunk/blender/source/blender/editors/armature/meshlaplacian.c	2012-02-17 17:47:10 UTC (rev 44201)
@@ -181,9 +181,9 @@
 	t2= cotan_weight(v2, v3, v1);
 	t3= cotan_weight(v3, v1, v2);
 
-	if(RAD2DEGF(angle_v3v3v3(v2, v1, v3)) > 90) obtuse= 1;
-	else if(RAD2DEGF(angle_v3v3v3(v1, v2, v3)) > 90) obtuse= 2;
-	else if(RAD2DEGF(angle_v3v3v3(v1, v3, v2)) > 90) obtuse= 3;
+	if     (angle_v3v3v3(v2, v1, v3) > DEG2RADF(90.0f)) obtuse= 1;
+	else if(angle_v3v3v3(v1, v2, v3) > DEG2RADF(90.0f)) obtuse= 2;
+	else if(angle_v3v3v3(v1, v3, v2) > DEG2RADF(90.0f)) obtuse= 3;
 
 	if (obtuse > 0) {
 		area= area_tri_v3(v1, v2, v3);




More information about the Bf-blender-cvs mailing list