public void UpdateFairingNodes() { ROLLog.log($"UpdateFairingNodes()"); foreach (ROLNodeFairingData data in fairingParts) { ROLLog.log($"fairingName: {fairingName}"); // Update the Nose Interstage Node if (fairingName == "Top Fairing") { Vector3 pos = new Vector3(0, data.topY, 0); ROLLog.log($"data.topY: {data.topY}"); ROLSelectableNodes.updateNodePosition(part, noseFairingNode, pos); if (part.FindAttachNode(noseFairingNode) is AttachNode noseInterstage) { ROLAttachNodeUtils.updateAttachNodePosition(part, noseInterstage, pos, Vector3.up, true, 2); } } // Update the Mount Interstage Node if (fairingName == "Bottom Fairing") { Vector3 pos = new Vector3(0, data.bottomY, 0); ROLSelectableNodes.updateNodePosition(part, data.mountNode, pos); if (part.FindAttachNode(mountFairingNode) is AttachNode mountInterstage) { ROLAttachNodeUtils.updateAttachNodePosition(part, mountInterstage, pos, Vector3.down, true, 2); } } } }
/// <summary> /// Update the attach nodes for the current model-module configuration. /// The 'nose' module is responsible for updating of upper attach nodes, while the 'mount' module is responsible for lower attach nodes. /// Also includes updating of 'interstage' nose/mount attach nodes. /// Also includes updating of surface-attach node position. /// Also includes updating of any parts that are surface attached to this part. /// </summary> /// <param name="userInput"></param> public void updateAttachNodes(bool userInput) { //update the standard top and bottom attach nodes, using the node position(s) defined in the nose and mount modules noseModule.updateAttachNodeTop("top", userInput); mountModule.updateAttachNodeBottom("bottom", userInput); //update the model-module specific attach nodes, using the per-module node definitions from the part noseModule.updateAttachNodeBody(noseNodeNames, userInput); coreModule.updateAttachNodeBody(coreNodeNames, userInput); mountModule.updateAttachNodeBody(mountNodeNames, userInput); // Update the Nose Interstage Node float y = noseModule.modulePosition + noseModule.moduleVerticalScale; int nodeSize = Mathf.RoundToInt(coreModule.moduleDiameter) + 1; Vector3 pos = new Vector3(0, y, 0); ROLSelectableNodes.updateNodePosition(part, noseInterstageNode, pos); AttachNode noseInterstage = part.FindAttachNode(noseInterstageNode); if (noseInterstage != null) { ROLAttachNodeUtils.updateAttachNodePosition(part, noseInterstage, pos, Vector3.up, userInput, nodeSize); } // Update the Mount Interstage Node y = mountModule.modulePosition + mountModule.moduleVerticalScale; nodeSize = Mathf.RoundToInt(coreModule.moduleDiameter) + 1; pos = new Vector3(0, y, 0); ROLSelectableNodes.updateNodePosition(part, mountInterstageNode, pos); AttachNode mountInterstage = part.FindAttachNode(mountInterstageNode); if (mountInterstage != null) { ROLAttachNodeUtils.updateAttachNodePosition(part, mountInterstage, pos, Vector3.down, userInput, nodeSize); } //update surface attach node position, part position, and any surface attached children AttachNode surfaceNode = part.srfAttachNode; if (surfaceNode != null) { coreModule.updateSurfaceAttachNode(surfaceNode, prevDiameter, userInput); } }