X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.plant3d%2Fsrc%2Forg%2Fsimantics%2Fplant3d%2Fscenegraph%2Fcontrolpoint%2FPipeControlPoint.java;h=124e54bb15761dc7451c63c5a9a4fd3af70335e5;hb=bf8d749e159470552b86484450b8b227b7985559;hp=fdb413ee39316b1cbc0652a4e2360c0ceb105b39;hpb=5303ddc439764f9263054f519deab7f9f350d561;p=simantics%2F3d.git diff --git a/org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/controlpoint/PipeControlPoint.java b/org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/controlpoint/PipeControlPoint.java index fdb413ee..124e54bb 100644 --- a/org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/controlpoint/PipeControlPoint.java +++ b/org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/controlpoint/PipeControlPoint.java @@ -791,9 +791,15 @@ public class PipeControlPoint extends G3DNode implements IP3DNode { } /** - * Returns direction vector. + * Returns direction vector pointing towards an adjacent component for + * directed control points or turn control points with one open end. * - * For directed control points, always returns outwards pointing vector. + * Always returns an outwards pointing vector. + * + * For any other type of component, the return value is null. + * + * For turn components this only return a non-null value for the unconnected + * end of the component. * * @param direction * @return normalized vector, or null @@ -837,6 +843,7 @@ public class PipeControlPoint extends G3DNode implements IP3DNode { Vector3d offset = new Vector3d(); MathTools.rotate(q2, v, offset); MathTools.rotate(q, offset, dir); + dir.negate(); dir.normalize(); return dir; }