rename overlap to holes for isect_point_poly_v2

This commit is contained in:
Campbell Barton
2013-10-05 12:36:35 +00:00
parent 1f53674bb8
commit 8ccf118058
2 changed files with 6 additions and 6 deletions

View File

@@ -155,8 +155,8 @@ bool isect_ray_tri_epsilon_v3(const float p1[3], const float d[3],
const float v0[3], const float v1[3], const float v2[3], float *r_lambda, float r_uv[2], const float epsilon);
/* point in polygon */
bool isect_point_poly_v2(const float pt[2], const float verts[][2], const unsigned int nr, const bool use_overlap);
bool isect_point_poly_v2_int(const int pt[2], const int verts[][2], const unsigned int nr, const bool use_overlap);
bool isect_point_poly_v2(const float pt[2], const float verts[][2], const unsigned int nr, const bool use_holes);
bool isect_point_poly_v2_int(const int pt[2], const int verts[][2], const unsigned int nr, const bool use_holes);
int isect_point_quad_v2(const float p[2], const float a[2], const float b[2], const float c[2], const float d[2]);

View File

@@ -713,7 +713,7 @@ int isect_line_sphere_v2(const float l1[2], const float l2[2],
/* point in polygon (keep float and int versions in sync) */
bool isect_point_poly_v2(const float pt[2], const float verts[][2], const unsigned int nr,
const bool use_overlap)
const bool use_holes)
{
/* we do the angle rule, define that all added angles should be about zero or (2 * PI) */
float angletot = 0.0;
@@ -751,7 +751,7 @@ bool isect_point_poly_v2(const float pt[2], const float verts[][2], const unsign
}
angletot = fabsf(angletot);
if (use_overlap) {
if (use_holes) {
const int nested = floorf((angletot / (float)(M_PI * 2.0)) + 0.00001f);
angletot -= nested * (float)(M_PI * 2.0);
return (angletot > 4.0f) != (nested % 2);
@@ -761,7 +761,7 @@ bool isect_point_poly_v2(const float pt[2], const float verts[][2], const unsign
}
}
bool isect_point_poly_v2_int(const int pt[2], const int verts[][2], const unsigned int nr,
const bool use_overlap)
const bool use_holes)
{
/* we do the angle rule, define that all added angles should be about zero or (2 * PI) */
float angletot = 0.0;
@@ -799,7 +799,7 @@ bool isect_point_poly_v2_int(const int pt[2], const int verts[][2], const unsign
}
angletot = fabsf(angletot);
if (use_overlap) {
if (use_holes) {
const int nested = floorf((angletot / (float)(M_PI * 2.0)) + 0.00001f);
angletot -= nested * (float)(M_PI * 2.0);
return (angletot > 4.0f) != (nested % 2);