Skip to content
Snippets Groups Projects
Verified Commit 3cac8a10 authored by Robotka István Adrián's avatar Robotka István Adrián
Browse files

ahhhhhhh3

parent df203e1f
Branches
No related tags found
No related merge requests found
......@@ -231,13 +231,11 @@ class Triangulated : public Drawable {
bool checkPotDiag(std::vector<vec2>::iterator currVertex) {
vec2 currPotDiag1 = *getNextVertex(currVertex);
vec2 currPotDiag2 = *getPreviousVertex(currVertex);
for (
auto currEdgeStart = getPreviousVertex(getPreviousVertex(currVertex));
currEdgeStart != getNextVertex(getNextVertex(currVertex));
currEdgeStart = getPreviousVertex(currEdgeStart)
for (auto currEdgeStart = getNextVertex(currVertex);
currEdgeStart != getPreviousVertex(currVertex);
currEdgeStart = getNextVertex(currEdgeStart)
)
if (intersectEachOther(vec2(currEdgeStart->x, currEdgeStart->y),
vec2(getNextVertex(currEdgeStart)->x, getNextVertex(currEdgeStart)->y),
if (intersectEachOther(*currEdgeStart, *getNextVertex(currEdgeStart),
currPotDiag1, currPotDiag2)) {
return false;
}
......@@ -256,7 +254,7 @@ class Triangulated : public Drawable {
currEdgeStart != remainingVertices.end();
currEdgeStart = getNextVertex(currEdgeStart)
)
if (intersectEachOther(currEdgeStart->x, *getNextVertex(currEdgeStart),
if (intersectEachOther(*currEdgeStart, *getNextVertex(currEdgeStart),
middle, infinity))
numberOfIntersections++;
return numberOfIntersections % 2 == 1;
......@@ -267,7 +265,7 @@ public:
explicit Triangulated(std::vector<vec2> points) : remainingVertices(std::move(points)) {
vertices.reserve(remainingVertices.size() * 3);
//triangulate();
triangulate();
};
void triangulate() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment