diff options
author | Martin Poirier <theeth@yahoo.com> | 2009-09-06 05:11:47 +0400 |
---|---|---|
committer | Martin Poirier <theeth@yahoo.com> | 2009-09-06 05:11:47 +0400 |
commit | a46beac3f87ee78d6231b2f0038db31c50aa2315 (patch) | |
tree | 6a8faa1ab49f4d64c6c23efc4437d5bc3c514d75 /source/blender/blenlib | |
parent | c9dd69c11a639aece463dac9018e88dede4b9515 (diff) |
Rename Vec3ToTangent VecBisect3, since that's what it does.
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/BLI_arithb.h | 2 | ||||
-rw-r--r-- | source/blender/blenlib/intern/arithb.c | 9 |
2 files changed, 5 insertions, 6 deletions
diff --git a/source/blender/blenlib/BLI_arithb.h b/source/blender/blenlib/BLI_arithb.h index 63b351016d4..86b626dabdf 100644 --- a/source/blender/blenlib/BLI_arithb.h +++ b/source/blender/blenlib/BLI_arithb.h @@ -270,7 +270,7 @@ void AxisAngleToQuat(float *q, float *axis, float angle); 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); diff --git a/source/blender/blenlib/intern/arithb.c b/source/blender/blenlib/intern/arithb.c index 970d8f7d0de..c20794953b9 100644 --- a/source/blender/blenlib/intern/arithb.c +++ b/source/blender/blenlib/intern/arithb.c @@ -2969,17 +2969,16 @@ void VecRotToQuat( float *vec, float phi, float *quat) } } -/* 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 |