import org.simantics.g3d.math.MathTools;
import org.simantics.g3d.property.annotations.GetPropertyValue;
import org.simantics.g3d.scenegraph.G3DNode;
-import org.simantics.g3d.scenegraph.base.ParentNode;
import org.simantics.plant3d.scenegraph.IP3DNode;
import org.simantics.plant3d.scenegraph.Nozzle;
import org.simantics.plant3d.scenegraph.P3DRootNode;
Vector3d pos = getWorldPosition();
switch (type) {
case NEXT: {
- Vector3d dir = getInlineDir();
double length = getInlineLength();
+ Vector3d dir;
+ if (isInline()) {
+ dir = getInlineDir();
+ } else {
+ dir = getPathLegDirection(Direction.NEXT);
+ }
dir.scale(length);
pos.add(dir);
break;
}
case PREVIOUS: {
- Vector3d dir = getInlineDir();
double length = getInlineLength();
- dir.scale(-length);
+ Vector3d dir;
+ if (isInline()) {
+ dir = getInlineDir();
+ dir.negate();
+ } else {
+ dir = getPathLegDirection(Direction.PREVIOUS);
+ }
+ dir.scale(length);
pos.add(dir);
break;
}