X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Fedu%2Fberkeley%2Fqfat%2FMesh.java;h=94b4e73c68863adee3ca9b128d87333a800fb981;hb=162b76f92f5adaf80b312bee2a6bcd5b7ba2eabd;hp=3b39842b7d85fcd779470652d6977f832a6fa28f;hpb=316044467afed9ea9df7fb373a0ab1ed2f7a901b;p=anneal.git diff --git a/src/edu/berkeley/qfat/Mesh.java b/src/edu/berkeley/qfat/Mesh.java index 3b39842..94b4e73 100644 --- a/src/edu/berkeley/qfat/Mesh.java +++ b/src/edu/berkeley/qfat/Mesh.java @@ -11,8 +11,8 @@ import edu.berkeley.qfat.geom.Point; public class Mesh implements Iterable { - public static float EPSILON = (float)0.0001; - public static Random random = new Random(); + public static final float EPSILON = (float)0.0001; + public static final Random random = new Random(); private PointSet pointset = new PointSet(); @@ -98,7 +98,6 @@ public class Mesh implements Iterable { return (float)total; } - public class BindingGroup { public HashSet es = new HashSet(); public BindingGroup() { } @@ -139,8 +138,6 @@ public class Mesh implements Iterable { public Point getPoint() { return p; } private Vert(Point p) { this.p = p; - //this.e = e; - //if (e==null) throw new Error(); if (pointset.get(p) != null) throw new Error(); pointset.add(this); } @@ -193,8 +190,6 @@ public class Mesh implements Iterable { /** does NOT update bound pairs! */ public boolean transform(Matrix m) { - // FIXME: screws up kdtree - // FIXME: screws up hashmap unscore(); try { if (pointset.get(this.p)==null) throw new Error(); @@ -203,7 +198,6 @@ public class Mesh implements Iterable { float newy = m.e*p.x + m.f*p.y + m.g*p.z + m.h; float newz = m.i*p.x + m.j*p.y + m.k*p.z + m.l; this.p = new Point(newx, newy, newz); - // FIXME: what if we move onto exactly where another point is? pointset.add(this); } catch (Exception e) { throw new RuntimeException(e); @@ -310,6 +304,7 @@ public class Mesh implements Iterable { E next; // next half-edge E pair; // partner half-edge public BindingGroup bg = new BindingGroup(this); + boolean shattered = false; public int compareTo(E e) { return e.length() > length() ? 1 : -1; } @@ -325,7 +320,6 @@ public class Mesh implements Iterable { } } - boolean shattered = false; public Point shatter() { return shatter(midpoint(), null, null); } public Point shatter(Point mid, BindingGroup bg1, BindingGroup bg2) { if (shattered) return mid;