checkpoint
[anneal.git] / src / edu / berkeley / qfat / Mesh.java
index 1a210cd..3a4cba5 100644 (file)
@@ -96,20 +96,16 @@ public class Mesh implements Iterable<Mesh.T> {
             gl.glNormal3f(norm.x, norm.y, norm.z);
         }
 
-        public void recomputeFundamentalQuadric() {
-            unApplyQuadricToNeighbor();
-            if (quadricStale || fundamentalQuadric==null) {
-                Matrix m = Matrix.ZERO;
-                int count = 0;
-                for(E e = this.e; e!=null; e=e.pair.next==this.e?null:e.pair.next) {
-                    T t = e.t;
-                    m = m.plus(t.norm().fundamentalQuadric(t.centroid()));
-                    count++;
-                }
-                quadricStale = false;
-                fundamentalQuadric = m.times(1/(float)count);
+        public void _recomputeFundamentalQuadric() {
+            Matrix m = Matrix.ZERO;
+            int count = 0;
+            for(E e = this.e; e!=null; e=e.pair.next==this.e?null:e.pair.next) {
+                T t = e.t;
+                m = m.plus(t.norm().fundamentalQuadric(t.centroid()));
+                count++;
             }
-            applyQuadricToNeighbor();
+            quadricStale = false;
+            fundamentalQuadric = m.times(1/(float)count);
         }
 
         public void applyQuadricToNeighbor() {
@@ -124,14 +120,18 @@ public class Mesh implements Iterable<Mesh.T> {
             nearest_in_other_mesh = new_nearest;
                 
             // don't attract to vertices that face the other way
+
             if (((Vertex)nearest_in_other_mesh).e == null || ((Vertex)nearest_in_other_mesh).norm().dot(norm()) < 0) {
                 nearest_in_other_mesh = null;
             } else {
+
                 nearest_in_other_mesh.unComputeError();
                 nearest_in_other_mesh.quadric = nearest_in_other_mesh.quadric.plus(fundamentalQuadric());
                 nearest_in_other_mesh.quadric_count++;
                 nearest_in_other_mesh.computeError();
+
             }
+
             reComputeError();
         }