X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.plant3d%2Fsrc%2Forg%2Fsimantics%2Fplant3d%2Factions%2FTranslateInlineAction.java;h=1bb2874c5b0031feb6ab8d77efd312f2370efdf2;hb=53d55c24c779745f188bdb18d32f71d20acb61b2;hp=c8c862240e76659e1ce0c6a92c2b4d1181796efb;hpb=f36217aeeb09c0c46f99886ee99772156ce9cfe6;p=simantics%2F3d.git diff --git a/org.simantics.plant3d/src/org/simantics/plant3d/actions/TranslateInlineAction.java b/org.simantics.plant3d/src/org/simantics/plant3d/actions/TranslateInlineAction.java index c8c86224..1bb2874c 100644 --- a/org.simantics.plant3d/src/org/simantics/plant3d/actions/TranslateInlineAction.java +++ b/org.simantics.plant3d/src/org/simantics/plant3d/actions/TranslateInlineAction.java @@ -62,13 +62,13 @@ public class TranslateInlineAction extends TranslateAction{ // We may have offsets in the path leg, hence we have to project the coordinates. Vector3d wp = node.getWorldPosition(); if (prev.getControlPoint().isVariableLength()) - s = MathTools.closestPointOnStraight(ps, wp, dir); + s = MathTools.closestPointOnStraight(ps, wp, dir); else - s = MathTools.closestPointOnStraight(pe, wp, dir); + s = MathTools.closestPointOnStraight(pe, wp, dir); if (next.getControlPoint().isVariableLength()) - e = MathTools.closestPointOnStraight(ne, wp, dir); + e = MathTools.closestPointOnStraight(ne, wp, dir); else - e = MathTools.closestPointOnStraight(ns, wp, dir); + e = MathTools.closestPointOnStraight(ns, wp, dir); // Remove component's own space from end points to get actual movement range double l = comp.getControlPoint().getInlineLength(); Vector3d ld = new Vector3d(dir); @@ -132,13 +132,13 @@ public class TranslateInlineAction extends TranslateAction{ Vector3d p = node.getWorldPosition(); Vector3d i1 = new Vector3d(); - Vector3d i2 = new Vector3d(); - - double mu[] = new double[2]; - MathTools.intersectStraightStraight( p, dir,ray.pos, ray.dir, i2, i1,mu); - - Vector3d t = MathTools.closestPointOnEdge(i1, s, e); - return t; + Vector3d i2 = new Vector3d(); + + double mu[] = new double[2]; + MathTools.intersectStraightStraight( p, dir,ray.pos, ray.dir, i2, i1,mu); + + Vector3d t = MathTools.closestPointOnEdge(i1, s, e); + return t; }