[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23044] branches/blender2.5/blender/source /blender: svn merge https://svn.blender.org/svnroot/bf-blender/trunk/ blender -r23023:HEAD
Campbell Barton
ideasman42 at gmail.com
Mon Sep 7 10:37:28 CEST 2009
Revision: 23044
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23044
Author: campbellbarton
Date: 2009-09-07 10:37:28 +0200 (Mon, 07 Sep 2009)
Log Message:
-----------
svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r23023:HEAD
Modified Paths:
--------------
branches/blender2.5/blender/source/blender/blenkernel/intern/curve.c
branches/blender2.5/blender/source/blender/blenlib/BLI_arithb.h
branches/blender2.5/blender/source/blender/blenlib/intern/arithb.c
branches/blender2.5/blender/source/blender/imbuf/intern/anim5.c
branches/blender2.5/blender/source/blender/makesdna/DNA_curve_types.h
Modified: branches/blender2.5/blender/source/blender/blenkernel/intern/curve.c
===================================================================
--- branches/blender2.5/blender/source/blender/blenkernel/intern/curve.c 2009-09-07 08:31:03 UTC (rev 23043)
+++ branches/blender2.5/blender/source/blender/blenkernel/intern/curve.c 2009-09-07 08:37:28 UTC (rev 23044)
@@ -1820,14 +1820,14 @@
bl= blnext;
}
- /* STEP 3: COUNT POLYS TELLEN AND AUTOHOLE */
+ /* STEP 3: POLYS COUNT AND AUTOHOLE */
bl= cu->bev.first;
poly= 0;
while(bl) {
if(bl->nr && bl->poly>=0) {
poly++;
bl->poly= poly;
- bl->gat= 0; /* 'gat' is dutch for hole */
+ bl->hole= 0;
}
bl= bl->next;
}
@@ -1879,7 +1879,7 @@
sd1= sortdata+ (a-1);
for(b=a-1; b>=0; b--, sd1--) { /* all polys to the left */
if(bevelinside(sd1->bl, bl)) {
- bl->gat= 1- sd1->bl->gat;
+ bl->hole= 1- sd1->bl->hole;
break;
}
}
@@ -1889,7 +1889,7 @@
if((cu->flag & CU_3D)==0) {
sd= sortdata;
for(a=0; a<poly; a++, sd++) {
- if(sd->bl->gat==sd->dir) {
+ if(sd->bl->hole==sd->dir) {
bl= sd->bl;
bevp1= (BevPoint *)(bl+1);
bevp2= bevp1+ (bl->nr-1);
@@ -1940,7 +1940,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];
@@ -1961,7 +1961,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);
@@ -2013,7 +2013,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;
@@ -2051,7 +2051,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);
@@ -2070,7 +2070,7 @@
}
QUATCOPY(quat_prev, quat); /* quat_prev can't have the tilt applied */
VECCOPY(vec_prev, vec);
-
+
AxisAngleToQuat(q, vec, bevp1->alfa);
QuatMul(quat, q, quat);
QuatToMat3(quat, bevp1->mat);
Modified: branches/blender2.5/blender/source/blender/blenlib/BLI_arithb.h
===================================================================
--- branches/blender2.5/blender/source/blender/blenlib/BLI_arithb.h 2009-09-07 08:31:03 UTC (rev 23043)
+++ branches/blender2.5/blender/source/blender/blenlib/BLI_arithb.h 2009-09-07 08:37:28 UTC (rev 23044)
@@ -380,7 +380,8 @@
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 VecReflect(float *out, float *v1, float *v2);
+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: branches/blender2.5/blender/source/blender/blenlib/intern/arithb.c
===================================================================
--- branches/blender2.5/blender/source/blender/blenlib/intern/arithb.c 2009-09-07 08:31:03 UTC (rev 23043)
+++ branches/blender2.5/blender/source/blender/blenlib/intern/arithb.c 2009-09-07 08:37:28 UTC (rev 23044)
@@ -3374,19 +3374,41 @@
}
}
-/* 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);
}
+/* Returns a reflection vector from a vector and a normal vector
+reflect = vec - ((2 * DotVecs(vec, mirror)) * mirror)
+*/
+void VecReflect(float *out, float *v1, float *v2)
+{
+ float vec[3], normal[3];
+ float reflect[3] = {0.0f, 0.0f, 0.0f};
+ float dot2;
+
+ VecCopyf(vec, v1);
+ VecCopyf(normal, v2);
+
+ Normalize(normal);
+
+ dot2 = 2 * Inpf(vec, normal);
+
+ reflect[0] = vec[0] - (dot2 * normal[0]);
+ reflect[1] = vec[1] - (dot2 * normal[1]);
+ reflect[2] = vec[2] - (dot2 * normal[2]);
+
+ VecCopyf(out, reflect);
+}
+
/* Return the angle in degrees between vecs 1-2 and 2-3 in degrees
If v1 is a shoulder, v2 is the elbow and v3 is the hand,
this would return the angle at the elbow */
Modified: branches/blender2.5/blender/source/blender/imbuf/intern/anim5.c
===================================================================
--- branches/blender2.5/blender/source/blender/imbuf/intern/anim5.c 2009-09-07 08:31:03 UTC (rev 23043)
+++ branches/blender2.5/blender/source/blender/imbuf/intern/anim5.c 2009-09-07 08:37:28 UTC (rev 23044)
@@ -210,12 +210,12 @@
int *ofspoint;
uchar **planes;
- /* samenstelling delta:
- lijst met ofsets voor delta's per bitplane (ofspoint)
- per kolom in delta (point)
- aantal handelingen (noops)
+ /* composition delta:
+ list with ofsets for delta' s by bitplane (ofspoint)
+ by column in delta (point)
+ number of operations (noops)
code
- bijbehorende data
+ associated data
...
...
*/
Modified: branches/blender2.5/blender/source/blender/makesdna/DNA_curve_types.h
===================================================================
--- branches/blender2.5/blender/source/blender/makesdna/DNA_curve_types.h 2009-09-07 08:31:03 UTC (rev 23043)
+++ branches/blender2.5/blender/source/blender/makesdna/DNA_curve_types.h 2009-09-07 08:37:28 UTC (rev 23044)
@@ -64,7 +64,7 @@
typedef struct BevList {
struct BevList *next, *prev;
int nr, flag;
- short poly, gat;
+ short poly, hole;
} BevList;
/* These two Lines with # tell makesdna this struct can be excluded. */
More information about the Bf-blender-cvs
mailing list