|
|
@ -335,7 +335,7 @@ typedef struct World |
|
|
const plane_t* plane = &planes[face->plane_id]; |
|
|
const plane_t* plane = &planes[face->plane_id]; |
|
|
|
|
|
|
|
|
// Check if the point lies on the face's plane (it's not strictly necessary to do this, but this check makes the whole function a lot faster) |
|
|
// Check if the point lies on the face's plane (it's not strictly necessary to do this, but this check makes the whole function a lot faster) |
|
|
if (fabs(plane->pointDistance(point)) > 0.001) |
|
|
|
|
|
|
|
|
if (fabs(plane->pointDistance(point)) > 0.01) |
|
|
continue; |
|
|
continue; |
|
|
|
|
|
|
|
|
// Check if the point is contained within the face's polygon |
|
|
// Check if the point is contained within the face's polygon |
|
|
@ -363,7 +363,7 @@ typedef struct World |
|
|
double m0 = p0.magnitude(); |
|
|
double m0 = p0.magnitude(); |
|
|
double m1 = p1.magnitude(); |
|
|
double m1 = p1.magnitude(); |
|
|
|
|
|
|
|
|
if ((m0 * m1) <= 0.001) |
|
|
|
|
|
|
|
|
if ((m0 * m1) <= 0.01) |
|
|
{ |
|
|
{ |
|
|
// Point is on one of the vertices |
|
|
// Point is on one of the vertices |
|
|
outFaces.push_back(face); |
|
|
outFaces.push_back(face); |
|
|
@ -375,7 +375,7 @@ typedef struct World |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// If the point is inside the polygon, then the sum of all the above angles will be exactly 360 degrees |
|
|
// If the point is inside the polygon, then the sum of all the above angles will be exactly 360 degrees |
|
|
if (fabs(2 * M_PI - angleSum) <= 0.001) |
|
|
|
|
|
|
|
|
if (fabs(2 * M_PI - angleSum) <= 0.01) |
|
|
outFaces.push_back(face); |
|
|
outFaces.push_back(face); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|