/// <summary> /// Rebuild fairing for current parameters /// </summary> private void buildFairing() { MonoBehaviour.print("Rebuilding fairing. Top: " + currentTopDiameter + " bot: " + currentBottomDiameter + " taper: " + currentTaperHeight + " height: " + currentHeight); fairingBase.clearProfile(); UVMap uvs = UVMap.GetUVMapGlobal(uvMap); fairingBase.outsideUV = uvs.getArea("outside"); fairingBase.insideUV = uvs.getArea("inside"); fairingBase.edgesUV = uvs.getArea("edges"); float halfHeight = currentHeight * 0.5f; fairingBase.addRing(-halfHeight, currentBottomDiameter * 0.5f); if (currentTopDiameter != currentBottomDiameter) { fairingBase.addRing(-halfHeight + currentTaperHeight, currentBottomDiameter * 0.5f); } if (currentHeight != currentTaperHeight || currentTopDiameter == currentBottomDiameter) { fairingBase.addRing(halfHeight, currentTopDiameter * 0.5f); } fairingBase.generateColliders = this.generateColliders; fairingBase.generateFairing(); fairingBase.setOpacity(HighLogic.LoadedSceneIsEditor && editorTransparency ? 0.25f : 1.0f); SSTUModInterop.onPartGeometryUpdate(part, true); SSTUStockInterop.fireEditorUpdate(); }
public void createFairing(Material material, float editorOpacity) { fairingBase.generateColliders = this.generateColliders; fairingBase.facesPerCollider = this.facesPerCollider; fairingBase.clearProfile(); fairingBase.setNumberOfPanels(numOfSections, false); fairingBase.addRing(bottomY, bottomRadius); fairingBase.addRing(topY, topRadius); fairingBase.generateFairing(); fairingBase.setMaterial(material); fairingBase.setOpacity(HighLogic.LoadedSceneIsEditor ? editorOpacity : 1.0f); }