[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23025] trunk/blender/source/blender: Rename Vec3ToTangent VecBisect3, since that's what it does.
Martin Poirier
theeth at yahoo.com
Sun Sep 6 03:11:48 CEST 2009
Revision: 23025
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23025
Author: theeth
Date: 2009-09-06 03:11:47 +0200 (Sun, 06 Sep 2009)
Log Message:
-----------
Rename Vec3ToTangent VecBisect3, since that's what it does.
Modified Paths:
--------------
trunk/blender/source/blender/blenkernel/intern/curve.c
trunk/blender/source/blender/blenlib/BLI_arithb.h
trunk/blender/source/blender/blenlib/intern/arithb.c
Modified: trunk/blender/source/blender/blenkernel/intern/curve.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/curve.c 2009-09-06 00:36:26 UTC (rev 23024)
+++ trunk/blender/source/blender/blenkernel/intern/curve.c 2009-09-06 01:11:47 UTC (rev 23025)
@@ -1903,7 +1903,7 @@
} /* this has to be >2 points */
else if(cu->flag & CU_NO_TWIST && cu->flag & CU_3D && bl->poly != -1) {
- /* Special case, cyclic curve with no twisy. tricky... */
+ /* Special case, cyclic curve with no twist. tricky... */
float quat[4], q[4], cross[3];
@@ -1924,7 +1924,7 @@
while(nr--) {
/* Normalizes */
- Vec3ToTangent(vec, &bevp0->x, &bevp1->x, &bevp2->x);
+ VecBisect3(vec, &bevp0->x, &bevp1->x, &bevp2->x);
if(bl->nr==nr+1) { /* first time */
vectoquat(vec, 5, 1, quat);
@@ -1976,7 +1976,7 @@
nr= bl->nr;
while(nr--) {
- Vec3ToTangent(vec, &bevp0->x, &bevp1->x, &bevp2->x);
+ VecBisect3(vec, &bevp0->x, &bevp1->x, &bevp2->x);
quat_tmp1= (float *)bevp1->mat;
quat_tmp2= quat_tmp1+4;
@@ -2014,7 +2014,7 @@
if(cu->flag & CU_3D) { /* 3D */
/* Normalizes */
- Vec3ToTangent(vec, &bevp0->x, &bevp1->x, &bevp2->x);
+ VecBisect3(vec, &bevp0->x, &bevp1->x, &bevp2->x);
if(bl->nr==nr+1 || !(cu->flag & CU_NO_TWIST)) { /* first time */
vectoquat(vec, 5, 1, quat);
Modified: trunk/blender/source/blender/blenlib/BLI_arithb.h
===================================================================
--- trunk/blender/source/blender/blenlib/BLI_arithb.h 2009-09-06 00:36:26 UTC (rev 23024)
+++ trunk/blender/source/blender/blenlib/BLI_arithb.h 2009-09-06 01:11:47 UTC (rev 23025)
@@ -270,7 +270,7 @@
void RotationBetweenVectorsToQuat(float *q, float v1[3], float v2[3]);
void vectoquat(float *vec, short axis, short upflag, float *q);
-void Vec3ToTangent(float *v, float *v1, float *v2, float *v3);
+void VecBisect3(float *v, float *v1, float *v2, float *v3);
float VecAngle2(float *v1, float *v2);
float VecAngle3(float *v1, float *v2, float *v3);
float NormalizedVecAngle2(float *v1, float *v2);
Modified: trunk/blender/source/blender/blenlib/intern/arithb.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/arithb.c 2009-09-06 00:36:26 UTC (rev 23024)
+++ trunk/blender/source/blender/blenlib/intern/arithb.c 2009-09-06 01:11:47 UTC (rev 23025)
@@ -2969,17 +2969,16 @@
}
}
-/* get a direction from 3 vectors that wont depend
- * on the distance between the points */
-void Vec3ToTangent(float *v, float *v1, float *v2, float *v3)
+/* Returns a vector bisecting the angle at v2 formed by v1, v2 and v3 */
+void VecBisect3(float *out, float *v1, float *v2, float *v3)
{
float d_12[3], d_23[3];
VecSubf(d_12, v2, v1);
VecSubf(d_23, v3, v2);
Normalize(d_12);
Normalize(d_23);
- VecAddf(v, d_12, d_23);
- Normalize(v);
+ VecAddf(out, d_12, d_23);
+ Normalize(out);
}
/* Return the angle in degrees between vecs 1-2 and 2-3 in degrees
More information about the Bf-blender-cvs
mailing list