From 1e2214af081840f74ebef09a7f9973cac3107d13 Mon Sep 17 00:00:00 2001 From: adam Date: Sat, 15 Dec 2007 18:48:48 -0800 Subject: [PATCH] checkpoint darcs-hash:20071216024848-5007d-58ff70a8f6504edb9737696ca94cb22932efb83d.gz --- src/edu/berkeley/qfat/Main.java | 4 ++-- src/edu/berkeley/qfat/Mesh.java | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/edu/berkeley/qfat/Main.java b/src/edu/berkeley/qfat/Main.java index 2fbd726..1a0239f 100644 --- a/src/edu/berkeley/qfat/Main.java +++ b/src/edu/berkeley/qfat/Main.java @@ -399,9 +399,9 @@ public class Main extends MeshViewer { "points_per_second=" + (count*1000)/((double)(System.currentTimeMillis()-then))); - for(Mesh.Vertex p : tile.vertices()) p.recomputeFundamentalQuadric(); + for(Mesh.Vertex p : goal.vertices()) p.recomputeFundamentalQuadricIfNeighborChanged(); repaint(); - for(Mesh.Vertex p : goal.vertices()) p.recomputeFundamentalQuadric(); + for(Mesh.Vertex p : tile.vertices()) p.recomputeFundamentalQuadric(); repaint(); synchronized(safeTriangles) { diff --git a/src/edu/berkeley/qfat/Mesh.java b/src/edu/berkeley/qfat/Mesh.java index fb99488..6db50dc 100644 --- a/src/edu/berkeley/qfat/Mesh.java +++ b/src/edu/berkeley/qfat/Mesh.java @@ -112,6 +112,10 @@ public class Mesh implements Iterable { gl.glNormal3f(norm.x, norm.y, norm.z); } + public void recomputeFundamentalQuadricIfNeighborChanged() { + if (score_against.nearest(p) == nearest_in_other_mesh) return; + recomputeFundamentalQuadric(); + } public void recomputeFundamentalQuadric() { unApplyQuadricToNeighbor(); if (quadricStale || fundamentalQuadric==null) { -- 1.7.10.4