MCPcopy Create free account
hub / github.com/BoomingTech/Piccolo / pnpoly

Function pnpoly

engine/3rdparty/tinyobjloader/tiny_obj_loader.h:1388–1398  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1386// code from https://wrf.ecse.rpi.edu//Research/Short_Notes/pnpoly.html
1387template <typename T>
1388static int pnpoly(int nvert, T *vertx, T *verty, T testx, T testy) {
1389 int i, j, c = 0;
1390 for (i = 0, j = nvert - 1; i < nvert; j = i++) {
1391 if (((verty[i] > testy) != (verty[j] > testy)) &&
1392 (testx <
1393 (vertx[j] - vertx[i]) * (testy - verty[i]) / (verty[j] - verty[i]) +
1394 vertx[i]))
1395 c = !c;
1396 }
1397 return c;
1398}
1399
1400// TODO(syoyo): refactor function.
1401static bool exportGroupsToShape(shape_t *shape, const PrimGroup &prim_group,

Callers 1

exportGroupsToShapeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected