- public Point getPoint() { return p; }
- private Vert(Point p) {
- this.p = p;
- if (pointset.get(p) != null) throw new Error();
- pointset.add(this);
- }
- public float score() { return oldscore; }
- public void unscore() {
- if (nearest_vert_in_other_mesh == null) return;
- nearest_vert_in_other_mesh.nearest_vert_in_other_mesh_x -= p.x;
- nearest_vert_in_other_mesh.nearest_vert_in_other_mesh_y -= p.y;
- nearest_vert_in_other_mesh.nearest_vert_in_other_mesh_z -= p.z;
- nearest_vert_in_other_mesh.nearest_vert_in_other_mesh_count--;
- if (nearest_vert_in_other_mesh.nearest_vert_in_other_mesh_count==0) {
- nearest_vert_in_other_mesh.nearest_vert_in_other_mesh_x = 0;
- nearest_vert_in_other_mesh.nearest_vert_in_other_mesh_y = 0;
- nearest_vert_in_other_mesh.nearest_vert_in_other_mesh_z = 0;
- }
- nearest_vert_in_other_mesh = null;
+ public void unApplyQuadricToNeighbor() {
+ if (nearest_in_other_mesh == null) return;
+ if (fundamentalQuadric == null) return;
+ nearest_in_other_mesh.unsc();
+ nearest_in_other_mesh.quadric = nearest_in_other_mesh.quadric.minus(fundamentalQuadric);
+ nearest_in_other_mesh.quadric_count--;
+ if (nearest_in_other_mesh.quadric_count==0)
+ nearest_in_other_mesh.quadric = Matrix.ZERO;
+ nearest_in_other_mesh.resc();
+ nearest_in_other_mesh = null;