rename overlap to holes for isect_point_poly_v2
This commit is contained in:
@@ -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]);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user