import javax.vecmath.AxisAngle4d;
import javax.vecmath.Matrix3d;
+import javax.vecmath.Point3d;
import javax.vecmath.Quat4d;
import javax.vecmath.Tuple3d;
import javax.vecmath.Vector3d;
if (currentNext.isVariableLength() && currentPrev.isVariableLength()) {
// we have to join them into single variable length component.
additionalRemove = currentPrev;
- //currentPrev.remove();
+ // combine lengths and set the location of remaining control point to the center.
+ Point3d ps = new Point3d();
+ Point3d pe = new Point3d();
+ Point3d ns = new Point3d();
+ Point3d ne = new Point3d();
+ currentPrev.getInlineControlPointEnds(ps, pe);
+ currentNext.getInlineControlPointEnds(ns, ne);
+ double l = currentPrev.getLength() + currentNext.getLength();
+ Vector3d cp = new Vector3d();
+ cp.add(ps, ne);
+ cp.scale(0.5);
+ currentNext.setLength(l);
+ currentNext.setWorldPosition(cp);
}
} else {
// FIXME : pipe run must be split into two parts, since the control point structure is no more continuous.