in ReplicaSDK/src/MirrorSurface.cpp [86:105]
bool MirrorSurface::InBoundary(const Eigen::Vector4f& p_w) {
Eigen::Vector2f pointInMani = (T_mani_plane * p_w).head<2>();
int v, u;
bool inBoundary = false;
int nVert = boundary_mani.size();
for (v = 0, u = nVert - 1; v < nVert; u = v++) {
if (((boundary_mani[v](1) > pointInMani(1)) != (boundary_mani[u](1) > pointInMani(1))) &&
(pointInMani(0) < (boundary_mani[u](0) - boundary_mani[v](0)) *
(pointInMani(1) - boundary_mani[v](1)) /
(boundary_mani[u](1) - boundary_mani[v](1)) +
boundary_mani[v](0))) {
inBoundary = !inBoundary;
}
}
return inBoundary;
}