+ public boolean move(Vec vv, boolean ignoreProblems) {
+
+ boolean good = true;
+
+ // t1' = M * t1
+ // t2' = t2.getMatrix(t1) * t1'
+ // t2' = t2.getMatrix(t1) * M * t1
+ // t1 = t1.getMatrix(t2) * t2
+ // M * t1 = M * t1.getMatrix(t2) * t2
+
+ if (bindingGroup!=null && this != bindingGroup.getMaster()) {
+ Matrix m2 = getBindingMatrix(bindingGroup.getMaster());
+ Vec v2 = m2.times(vv.plus(getPoint())).minus(m2.times(getPoint()));
+ return ((Vertex)bindingGroup.getMaster()).move(v2, ignoreProblems);
+ }
+
+ Point op = this.p;
+ Point pp = vv.plus(getPoint());
+ if (bindingGroup != null) {
+ /*
+ for(int i=0; i<20 ; i++) {
+ Point p2 = getConstraint().times(pp);
+ pp = pp.midpoint(p2);
+ //System.out.println(m.minus(m2));
+ }
+ */
+ pp = getConstraint().times(pp);
+ }
+ pp = pp.minus(op).norm().times(vv.mag()).plus(op);
+ ok = false;
+ Point pt = pp;
+ for(Vertex v : (Iterable<Vertex>)getBoundPeers()) {
+ Point pt2 = v.getBindingMatrix(this).times(pt);
+ /*
+ if (Math.abs( v.p.minus(pt2).mag() / pt.minus(op).mag() ) > 5)
+ throw new Error(v.p+" "+pt2+"\n"+op+" "+pt+"\n"+v.getBindingMatrix(this));
+ if (Math.abs( v.p.minus(pt2).mag() / pt.minus(op).mag() ) < 1/5) throw new Error();
+ */
+ good &= v.transform(pt2, ignoreProblems, v.getBindingMatrix(this));
+ }
+
+ if (!good && !ignoreProblems) {
+ for(Vertex v : (Iterable<Vertex>)getBoundPeers())
+ v.transform(v.oldp, true, null);
+ }
+
+ for(Vertex v : (Iterable<Vertex>)getBoundPeers())
+ v.recomputeFundamentalQuadricIfNeighborChanged();
+ for(Vertex v : (Iterable<Vertex>)getBoundPeers())
+ v.reComputeErrorAround();
+ ok = true;
+ return good;
+ }
+ public boolean ok = true;
+