diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-01-26 11:34:40 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-01-26 11:34:40 +0300 |
commit | 87627374000b7de7445736a7239a3f2b168ce7eb (patch) | |
tree | 2f0fe5d42d0938fc1b684af702d8613099bea1bd /source/blender/blenlib/intern/arithb.c | |
parent | 784d8ee37a52f3ef689aa6d02e75e50566efe93f (diff) | |
parent | ba8ea9ec63c25b1ce134a846176f7bf252f4d487 (diff) |
2.50: svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r17853:HEAD
Diffstat (limited to 'source/blender/blenlib/intern/arithb.c')
-rw-r--r-- | source/blender/blenlib/intern/arithb.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/blenlib/intern/arithb.c b/source/blender/blenlib/intern/arithb.c index a9e1e80a403..0d65e615039 100644 --- a/source/blender/blenlib/intern/arithb.c +++ b/source/blender/blenlib/intern/arithb.c @@ -2188,6 +2188,13 @@ void VecMulf(float *v1, float f) v1[2]*= f; } +void VecNegf(float *v1) +{ + v1[0] = -v1[0]; + v1[1] = -v1[1]; + v1[2] = -v1[2]; +} + void VecOrthoBasisf(float *v, float *v1, float *v2) { float f = sqrt(v[0]*v[0] + v[1]*v[1]); @@ -3950,7 +3957,7 @@ int SweepingSphereIntersectsTriangleUV(float p1[3], float p2[3], float radius, f Normalize(nor); /* flip normal */ - if(Inpf(nor,vel)>0.0f) VecMulf(nor,-1.0f); + if(Inpf(nor,vel)>0.0f) VecNegf(nor); a=Inpf(p1,nor)-Inpf(v0,nor); nordotv=Inpf(nor,vel); @@ -4682,7 +4689,7 @@ void tangent_from_uv(float *uv1, float *uv2, float *uv3, float *co1, float *co2, /* check flip */ if ((ct[0]*n[0] + ct[1]*n[1] + ct[2]*n[2]) < 0.0f) - VecMulf(tang, -1.0f); + VecNegf(tang); } /* used for zoom values*/ |