]> gerrit.simantics Code Review - simantics/3d.git/blobdiff - org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/controlpoint/PipeControlPoint.java
Use unique names at the model scope instead of pipe run
[simantics/3d.git] / org.simantics.plant3d / src / org / simantics / plant3d / scenegraph / controlpoint / PipeControlPoint.java
index 124e54bb15761dc7451c63c5a9a4fd3af70335e5..c5934b368edfe64987a79194f0a4a61146543617 100644 (file)
@@ -481,7 +481,7 @@ public class PipeControlPoint extends G3DNode implements IP3DNode {
                        q = getControlPointOrientationQuat(dir, 0.0);
                else
                        q = getControlPointOrientationQuat(dir, rotationAngle);
-               Vector3d v = new Vector3d(0.0,offset,0.0);
+               Vector3d v = new Vector3d(0.0,-offset,0.0);
                Vector3d offset = new Vector3d();
                MathTools.rotate(q, v, offset);
                return offset;
@@ -493,7 +493,7 @@ public class PipeControlPoint extends G3DNode implements IP3DNode {
                        q = getControlPointOrientationQuat(0.0);
                else
                        q = getControlPointOrientationQuat(rotationAngle);
-               Vector3d v = new Vector3d(0.0,offset,0.0);
+               Vector3d v = new Vector3d(0.0,-offset,0.0);
                Vector3d offset = new Vector3d();
                MathTools.rotate(q, v, offset);
                return offset;
@@ -750,9 +750,6 @@ public class PipeControlPoint extends G3DNode implements IP3DNode {
                        if (pcp.isDualSub()) {
                                pcp.getParentPoint().setNext(this);
                        }
-                       if (isDualInline()) {
-                           getDualSub().setPrevious(this);
-                       }
                } else {
                        // if direction is previous, user must have given sizechange
                        if (pcp.isDualSub())
@@ -954,6 +951,8 @@ public class PipeControlPoint extends G3DNode implements IP3DNode {
                        dir2.scale(length * 0.5);
                        dir1 = new Vector3d(dir2);
                        dir1.negate();
+               } else if (isEnd()) {
+                       dir2 = dir1 = new Vector3d();
                } else {
                        dir1 = getPathLegDirection(Direction.PREVIOUS);
                        dir2 = sub.getPathLegDirection(Direction.NEXT);