| 1449 | // code from https://wrf.ecse.rpi.edu//Research/Short_Notes/pnpoly.html |
| 1450 | template <typename T> |
| 1451 | static int pnpoly(int nvert, T *vertx, T *verty, T testx, T testy) { |
| 1452 | int i, j, c = 0; |
| 1453 | for (i = 0, j = nvert - 1; i < nvert; j = i++) { |
| 1454 | if (((verty[i] > testy) != (verty[j] > testy)) && |
| 1455 | (testx < |
| 1456 | (vertx[j] - vertx[i]) * (testy - verty[i]) / (verty[j] - verty[i]) + |
| 1457 | vertx[i])) |
| 1458 | c = !c; |
| 1459 | } |
| 1460 | return c; |
| 1461 | } |
| 1462 | |
| 1463 | struct TinyObjPoint { |
| 1464 | real_t x, y, z; |
no outgoing calls
no test coverage detected