addRing() public method

public addRing ( float height, float radius ) : void
height float
radius float
return void
コード例 #1
0
        /// <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();
        }
コード例 #2
0
ファイル: FairingData.cs プロジェクト: lynwoodm/SSTULabs
 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);
 }