From 60f44be2986b20ab2b562defc173a47b6cc32c98 Mon Sep 17 00:00:00 2001 From: TomyLobo Date: Thu, 8 Aug 2013 08:27:22 +0200 Subject: [PATCH] Minor polyhedron changes. --- .../worldedit/regions/ConvexPolyhedralRegion.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/sk89q/worldedit/regions/ConvexPolyhedralRegion.java b/src/main/java/com/sk89q/worldedit/regions/ConvexPolyhedralRegion.java index 788811ea5..cb20d24b9 100644 --- a/src/main/java/com/sk89q/worldedit/regions/ConvexPolyhedralRegion.java +++ b/src/main/java/com/sk89q/worldedit/regions/ConvexPolyhedralRegion.java @@ -134,12 +134,6 @@ public class ConvexPolyhedralRegion extends AbstractRegion { centerAccum = centerAccum.add(vertex); - /*if (contains(vertex)) { - return true; - }*/ - - lastTriangle = null; - if (minimumPoint == null) { minimumPoint = maximumPoint = vertex; } else { @@ -194,12 +188,17 @@ public class ConvexPolyhedralRegion extends AbstractRegion { } if (!vertexBacklog.isEmpty()) { + // Remove the new vertex vertices.remove(vertex); + + // Clone, clear and work through the backlog final List vertexBacklog2 = new ArrayList(vertexBacklog); vertexBacklog.clear(); for (Vector vertex2 : vertexBacklog2) { addVertex(vertex2); } + + // Re-add the new vertex after the backlog. vertices.add(vertex); }