- 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;
+ if (nearest_in_other_mesh == null) return;
+ if (fundamentalQuadric == null) return;
+ 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 = null;