public bool attemptMerge(Region r) { if (normal != r.getNormal ()) { // We definitly can't merge a region with another normal return false; } foreach (Face f1 in r.getFaces()) { foreach (Face f2 in faces) { if (f1.sharesVertex(f2)) { mergeWithRegion (r); return true; } } } return false; }
private void mergeWithRegion(Region r) { this.faces.AddRange(r.getFaces ()); this.edges.AddRange(r.getEdges ()); }