X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2FMain.java;fp=src%2FMain.java;h=bc01a062ccc7712b96fedf08fe385eecf8c27c34;hb=cb4f3272e7ed4c1c384dae4cd4edc20e3feda6c7;hp=5fae70a2f37fb90032805ce1cfb287f80efacd3d;hpb=2b22e6b0af24d1f81ced5f19ff6a742f60187d4e;p=anneal.git diff --git a/src/Main.java b/src/Main.java index 5fae70a..bc01a06 100644 --- a/src/Main.java +++ b/src/Main.java @@ -181,23 +181,23 @@ public class Main implements GLEventListener, MouseListener, MouseMotionListener for(Geom.T t2 : tile) { if (t1==t2) continue; - if ((t1.p1().times(m).minus(t2.p1()).mag() < Geom.EPSILON) && - (t1.p2().times(m).minus(t2.p3()).mag() < Geom.EPSILON) && - (t1.p3().times(m).minus(t2.p2()).mag() < Geom.EPSILON)) { + if ((t1.p1().p.times(m).minus(t2.p1().p).mag() < Geom.EPSILON) && + (t1.p2().p.times(m).minus(t2.p3().p).mag() < Geom.EPSILON) && + (t1.p3().p.times(m).minus(t2.p2().p).mag() < Geom.EPSILON)) { t1.e1().bind(t2.e3().pair); t1.e2().bind(t2.e2().pair); t1.e3().bind(t2.e1().pair); } - if ((t1.p2().times(m).minus(t2.p1()).mag() < Geom.EPSILON) && - (t1.p3().times(m).minus(t2.p3()).mag() < Geom.EPSILON) && - (t1.p1().times(m).minus(t2.p2()).mag() < Geom.EPSILON)) { + if ((t1.p2().p.times(m).minus(t2.p1().p).mag() < Geom.EPSILON) && + (t1.p3().p.times(m).minus(t2.p3().p).mag() < Geom.EPSILON) && + (t1.p1().p.times(m).minus(t2.p2().p).mag() < Geom.EPSILON)) { t1.e2().bind(t2.e3().pair); t1.e3().bind(t2.e2().pair); t1.e1().bind(t2.e1().pair); } - if ((t1.p3().times(m).minus(t2.p1()).mag() < Geom.EPSILON) && - (t1.p1().times(m).minus(t2.p3()).mag() < Geom.EPSILON) && - (t1.p2().times(m).minus(t2.p2()).mag() < Geom.EPSILON)) { + if ((t1.p3().p.times(m).minus(t2.p1().p).mag() < Geom.EPSILON) && + (t1.p1().p.times(m).minus(t2.p3().p).mag() < Geom.EPSILON) && + (t1.p2().p.times(m).minus(t2.p2().p).mag() < Geom.EPSILON)) { t1.e3().bind(t2.e3().pair); t1.e1().bind(t2.e2().pair); t1.e2().bind(t2.e1().pair); @@ -261,7 +261,7 @@ public class Main implements GLEventListener, MouseListener, MouseMotionListener r1 = r1 - (float)Math.floor(r1); r1 = r1 * (float)0.01; r1 = r1 - (float)0.005; - Geom.Vec v = p.watchback().minus(p).norm().times(r1); + Geom.Vec v = p.watchback().p.minus(p.p).norm().times(r1); //v = p.norm().times(v.dot(p.norm())); @@ -352,7 +352,7 @@ public class Main implements GLEventListener, MouseListener, MouseMotionListener i++; if (i != 1 /*&& i!=4*/) continue; Geom.V p = tile.newP(0, 0, 0).times(m).register(); - Geom.Vec v = tile.new Vec(p.x, p.y, p.z); + Geom.Vec v = tile.new Vec(p.p.x, p.p.y, p.p.z); v = v.times((float)1.04); gl.glTranslatef(v.x, v.y, v.z); draw(gl, false, tile); @@ -387,12 +387,12 @@ public class Main implements GLEventListener, MouseListener, MouseMotionListener gl.glEnd(); } else { gl.glBegin(GL.GL_LINES); - t.e1().p1.glVertex(gl); - t.e1().p2.glVertex(gl); - t.e2().p1.glVertex(gl); - t.e2().p2.glVertex(gl); - t.e3().p1.glVertex(gl); - t.e3().p2.glVertex(gl); + t.e1().p1.p.glVertex(gl); + t.e1().p2.p.glVertex(gl); + t.e2().p1.p.glVertex(gl); + t.e2().p2.p.glVertex(gl); + t.e3().p1.p.glVertex(gl); + t.e3().p2.p.glVertex(gl); gl.glEnd(); } @@ -406,9 +406,9 @@ public class Main implements GLEventListener, MouseListener, MouseMotionListener if (mesh==goal) for(Geom.V p : new Geom.V[] { t.p1(), t.p2(), t.p3() }) { - p.glVertex(gl); + p.p.glVertex(gl); //p.plus(p.norm().times(p.score()*10)).glVertex(gl); - p.partner().glVertex(gl); + p.partner().p.glVertex(gl); //tile.nearest(p).centroid().glVertex(gl); }