Matrix binding = Matrix.ONE;
Vertex bound_to = this;
+ private boolean good;
public Point getPoint() { return p; }
public float error() { return olderror; }
if (error_against==null) return null;
return error_against.vertices.nearest(p, this);
}
- public void unComputeError() { setError(0); }
+
public void computeError() {
float nerror =
quadric_count != 0
if (!ignorecollision && good) triangles.range(oldp, this.p, (Visitor<T>)this);
- reComputeErrorAround();
-
return good;
}
return true;
}
}
- private boolean good;
public boolean move(Vec v) {
Matrix m = Matrix.translate(v);
- Vertex p = this;
+
boolean good = true;
- do {
+ for(Vertex p = this; p != null; p = (p.bound_to==this)?null:p.bound_to)
good &= p.transform(m);
- p = p.bound_to;
- } while (p != this);
+
+ if (good) {
+ for(Vertex p = this; p != null; p = (p.bound_to==this)?null:p.bound_to)
+ p.reComputeErrorAround();
+ } else {
+ for(Vertex p = this; p != null; p = (p.bound_to==this)?null:p.bound_to)
+ p.transform(Matrix.translate(v.times(-1)));
+ }
return good;
}