- // FIXME: intersection test needed?
- boolean good = true;
- /*
- for(T t : Mesh.this) {
- if (!good) break;
- e = this.e;
- do {
- if (!t.has(e.p1) && !t.has(e.p2) && e.intersects(t)) { good = false; break; }
- if (e.t != null) {
- //if (!e.t.has(t.e1().p1) && !e.t.has(t.e1().p2) && t.e1().intersects(e.t)) { good = false; break; }
- //if (!e.t.has(t.e2().p1) && !e.t.has(t.e2().p2) && t.e2().intersects(e.t)) { good = false; break; }
- //if (!e.t.has(t.e3().p1) && !e.t.has(t.e3().p2) && t.e3().intersects(e.t)) { good = false; break; }
- }
- e = e.pair.next;
- } while(e != this.e);
+
+ if (!ignorecollision && good) {
+
+ tris.range(new Segment(oldp, this.p),
+ new Visitor<T>() {
+ public void visit(T t) {
+ if (!good) return;
+ E e = Vert.this.e;
+ do {
+ if (!t.has(e.p1) && !t.has(e.p2) && e.intersects(t)) { good = false; }
+ if (e.t != null) {
+ if (!e.t.has(t.e1().p1) && !e.t.has(t.e1().p2) && t.e1().intersects(e.t)) { good = false; }
+ if (!e.t.has(t.e2().p1) && !e.t.has(t.e2().p2) && t.e2().intersects(e.t)) { good = false; }
+ if (!e.t.has(t.e3().p1) && !e.t.has(t.e3().p2) && t.e3().intersects(e.t)) { good = false; }
+ }
+ e = e.pair.next;
+ } while(e != Vert.this.e);
+ }
+ });
+
+ /*
+ for(T t : Mesh.this) {
+ if (!good) break;
+ e = this.e;
+ do {
+ if (!t.has(e.p1) && !t.has(e.p2) && e.intersects(t)) { good = false; break; }
+ if (e.t != null) {
+ if (!e.t.has(t.e1().p1) && !e.t.has(t.e1().p2) && t.e1().intersects(e.t)) { good = false; break; }
+ if (!e.t.has(t.e2().p1) && !e.t.has(t.e2().p2) && t.e2().intersects(e.t)) { good = false; break; }
+ if (!e.t.has(t.e3().p1) && !e.t.has(t.e3().p2) && t.e3().intersects(e.t)) { good = false; break; }
+ }
+ e = e.pair.next;
+ } while(e != this.e);
+ }
+ */