Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-01-17 00:12:38 +0300
committerCampbell Barton <ideasman42@gmail.com>2011-01-17 00:12:38 +0300
commitfd448bcfc7a4bfb3698ec8d88094d439b94a1a92 (patch)
tree99c8cb2ccb36333aad404636288ebe7053a92f1a /source/blender/blenlib
parent26ee86b20dada4a46d31f34a25b063c65be0230c (diff)
remove/comment unused defines, also zero FileGlobal.filename to quiet valgrind.
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r--source/blender/blenlib/intern/math_geom.c28
1 files changed, 8 insertions, 20 deletions
diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c
index d25aefef543..15f696e073c 100644
--- a/source/blender/blenlib/intern/math_geom.c
+++ b/source/blender/blenlib/intern/math_geom.c
@@ -236,51 +236,39 @@ float dist_to_line_segment_v3(float *v1, float *v2, float *v3)
/* intersect Line-Line, shorts */
int isect_line_line_v2_short(const short *v1, const short *v2, const short *v3, const short *v4)
{
- /* return:
- -1: colliniar
- 0: no intersection of segments
- 1: exact intersection of segments
- 2: cross-intersection of segments
- */
float div, labda, mu;
div= (float)((v2[0]-v1[0])*(v4[1]-v3[1])-(v2[1]-v1[1])*(v4[0]-v3[0]));
- if(div==0.0f) return -1;
+ if(div==0.0f) return ISECT_LINE_LINE_COLINEAR;
labda= ((float)(v1[1]-v3[1])*(v4[0]-v3[0])-(v1[0]-v3[0])*(v4[1]-v3[1]))/div;
mu= ((float)(v1[1]-v3[1])*(v2[0]-v1[0])-(v1[0]-v3[0])*(v2[1]-v1[1]))/div;
if(labda>=0.0f && labda<=1.0f && mu>=0.0f && mu<=1.0f) {
- if(labda==0.0f || labda==1.0f || mu==0.0f || mu==1.0f) return 1;
- return 2;
+ if(labda==0.0f || labda==1.0f || mu==0.0f || mu==1.0f) return ISECT_LINE_LINE_EXACT;
+ return ISECT_LINE_LINE_CROSS;
}
- return 0;
+ return ISECT_LINE_LINE_NONE;
}
/* intersect Line-Line, floats */
int isect_line_line_v2(const float *v1, const float *v2, const float *v3, const float *v4)
{
- /* return:
- -1: colliniar
-0: no intersection of segments
-1: exact intersection of segments
-2: cross-intersection of segments
- */
float div, labda, mu;
div= (v2[0]-v1[0])*(v4[1]-v3[1])-(v2[1]-v1[1])*(v4[0]-v3[0]);
- if(div==0.0) return -1;
+ if(div==0.0) return ISECT_LINE_LINE_COLINEAR;
labda= ((float)(v1[1]-v3[1])*(v4[0]-v3[0])-(v1[0]-v3[0])*(v4[1]-v3[1]))/div;
mu= ((float)(v1[1]-v3[1])*(v2[0]-v1[0])-(v1[0]-v3[0])*(v2[1]-v1[1]))/div;
if(labda>=0.0 && labda<=1.0 && mu>=0.0 && mu<=1.0) {
- if(labda==0.0 || labda==1.0 || mu==0.0 || mu==1.0) return 1;
- return 2;
+ if(labda==0.0 || labda==1.0 || mu==0.0 || mu==1.0) return ISECT_LINE_LINE_EXACT;
+ return ISECT_LINE_LINE_CROSS;
}
- return 0;
+ return ISECT_LINE_LINE_NONE;
}
/* get intersection point of two 2D segments and return intersection type: