Skip to content
Snippets Groups Projects
Commit 306c749c authored by Brandon Lai-Cheong's avatar Brandon Lai-Cheong
Browse files

updates to triangle

parent c44ea7d8
No related branches found
No related tags found
No related merge requests found
......@@ -12,7 +12,15 @@ bool Triangle::pointInTriangle(const Point &p) const {
// all tests must be positive
auto edges = TriangleEdges(*this);
return !edges.e1.positiveSide(p) &&
!edges.e2.positiveSide(p) &&
!edges.e3.positiveSide(p);
for (int i = 0; i < NB_TRIANGLE_SIDES; i++) {
if (edges.edges[i].positiveSide(p)) {
return false;
}
}
return true;
}
int nextPoint(int pointIndex) {
return (pointIndex + 1) % 3;
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment