small corrections, no functionality change

This commit is contained in:
Campbell Barton 2009-11-12 12:48:39 +00:00
parent 9596b369bd
commit 4f47f21d44
4 changed files with 15 additions and 15 deletions

View File

@ -31,7 +31,7 @@
* The defined Below are for internal use only */
/* free vert flags */
#define eul 0.0000001f
#define eps 0.0000001f
#define BLF 1
#define TRF 2
#define TLF 4
@ -68,10 +68,10 @@
b->v[TR]->y = f;\
UPDATE_V34Y(b)
#define BOXINTERSECT(b1, b2)\
(!( BOXLEFT(b1)+eul>=BOXRIGHT(b2) ||\
BOXBOTTOM(b1)+eul>=BOXTOP(b2) ||\
BOXRIGHT(b1)-eul<=BOXLEFT(b2) ||\
BOXTOP(b1)-eul<=BOXBOTTOM(b2) ))
(!( BOXLEFT(b1)+eps>=BOXRIGHT(b2) ||\
BOXBOTTOM(b1)+eps>=BOXTOP(b2) ||\
BOXRIGHT(b1)-eps<=BOXLEFT(b2) ||\
BOXTOP(b1)-eps<=BOXBOTTOM(b2) ))
#define MIN2(x,y) ( (x)<(y) ? (x) : (y) )
#define MAX2(x,y) ( (x)>(y) ? (x) : (y) )

View File

@ -434,7 +434,7 @@ int isect_ray_tri_v3(float p1[3], float d[3], float v0[3], float v1[3], float v2
cross_v3_v3v3(p, d, e2);
a = dot_v3v3(e1, p);
/* note: these values were 0.000001 in 2.4x but for projection snapping on
* a human head (1BU==1m), subsurf level 2, this gave many errors */
* a human head (1BU==1m), subsurf level 2, this gave many errors - campbell */
if ((a > -0.00000001) && (a < 0.00000001)) return 0;
f = 1.0f/a;

View File

@ -152,12 +152,12 @@ static void rna_def_region(BlenderRNA *brna)
prop= RNA_def_property(srna, "width", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "winx");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Width", "Area width.");
RNA_def_property_ui_text(prop, "Width", "Region width.");
prop= RNA_def_property(srna, "height", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "winy");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Height", "Area height.");
RNA_def_property_ui_text(prop, "Height", "Region height.");
}
static void rna_def_screen(BlenderRNA *brna)

View File

@ -45,7 +45,7 @@
#include "BLI_math.h"
#define SWAP_FLOAT(a,b,tmp) tmp=a; a=b; b=tmp
#define eul 0.000001
#define eps 0.000001
/*-- forward declarations -- */
static PyObject *M_Geometry_PolyFill( PyObject * self, PyObject * polyLineSeq );
@ -252,18 +252,18 @@ static PyObject *M_Geometry_LineIntersect2D( PyObject * self, PyObject * args )
Py_RETURN_NONE;
}
/* Make sure the hoz/vert line comes first. */
if (fabs(b1x - b2x) < eul || fabs(b1y - b2y) < eul) {
if (fabs(b1x - b2x) < eps || fabs(b1y - b2y) < eps) {
SWAP_FLOAT(a1x, b1x, xi); /*abuse xi*/
SWAP_FLOAT(a1y, b1y, xi);
SWAP_FLOAT(a2x, b2x, xi);
SWAP_FLOAT(a2y, b2y, xi);
}
if (fabs(a1x-a2x) < eul) { /* verticle line */
if (fabs(b1x-b2x) < eul){ /*verticle second line */
if (fabs(a1x-a2x) < eps) { /* verticle line */
if (fabs(b1x-b2x) < eps){ /*verticle second line */
Py_RETURN_NONE; /* 2 verticle lines dont intersect. */
}
else if (fabs(b1y-b2y) < eul) {
else if (fabs(b1y-b2y) < eps) {
/*X of vert, Y of hoz. no calculation needed */
newvec[0]= a1x;
newvec[1]= b1y;
@ -280,8 +280,8 @@ static PyObject *M_Geometry_LineIntersect2D( PyObject * self, PyObject * args )
newvec[0]= a1x;
newvec[1]= yi;
return newVectorObject(newvec, 2, Py_NEW, NULL);
} else if (fabs(a2y-a1y) < eul) { /* hoz line1 */
if (fabs(b2y-b1y) < eul) { /*hoz line2*/
} else if (fabs(a2y-a1y) < eps) { /* hoz line1 */
if (fabs(b2y-b1y) < eps) { /*hoz line2*/
Py_RETURN_NONE; /*2 hoz lines dont intersect*/
}