scp.setWorldPosition(pos);
Vector3d dir = new Vector3d();
dir.sub(pcp2.getWorldPosition(), pcp1.getWorldPosition());
- updateControlPointOrientation(scp, dir);
+ scp.orientToDirection(dir);
scp.setLength(length);
validate(scp.getPipeRun());
return scp;
} else if (u.start.isEnd()) {
updateEndComponentControlPoint(u.start, u.dir);
} else if (u.start.isInline()) {
- updateControlPointOrientation(u.start, u.dir);
+ u.start.orientToDirection(u.dir);
}
if (u.end.isTurn()) {
//updateTurnControlPointTurn(u.end, u.end.getPrevious(), u.end.getNext());
} else if (u.end.isEnd()) {
updateEndComponentControlPoint(u.end, u.dir);
} else if (u.end.isInline()) {
- updateControlPointOrientation(u.end, u.dir);
+ u.end.orientToDirection(u.dir);
}
} else {
System.out.println(" " + newInlinePoint);
icp.setWorldPosition(newInlinePoint);
- updateControlPointOrientation(icp, dir);
+ icp.orientToDirection(dir);
}
/**
System.out.println("PipingRules.updateEndComponentControlPoint() " + ecp);
if (!ecp.isFixed()) // prevent overriding nozzle orientations..
- updateControlPointOrientation(ecp, dir);
+ ecp.orientToDirection(dir);
for (PipeControlPoint pcp : ecp.getChildPoints()) {
// TODO update position
}
}
- private static void updateControlPointOrientation(PipeControlPoint pcp, Vector3d dir) {
- Double angleO = pcp.getRotationAngle();
- double angle = 0.0;
- if (angleO != null)
- angle = angleO;
- boolean reversed = pcp._getReversed();
- Quat4d q = null;
- if (dir != null) {
- q = pcp.getControlPointOrientationQuat(dir, angle, reversed);
- } else {
- q = pcp.getControlPointOrientationQuat(angle, reversed);
- }
- pcp.setWorldOrientation(q);
- }
-
/**
* Updates all branches when branch's position has been changed
*
tcp.setTurnAxis(new Vector3d(MathTools.Y_AXIS));
}
- updateControlPointOrientation(tcp,prev);
+ tcp.orientToDirection(prev);
if (DEBUG)
System.out.println("PipingTools.updateTurnControlPointTurn " + prev + " " + next + " " + turnAngle + " " + turnAxis);