diff --git a/GameData/ProceduralFairings/ProceduralFairings.dll b/GameData/ProceduralFairings/ProceduralFairings.dll deleted file mode 100644 index d4cecd2..0000000 Binary files a/GameData/ProceduralFairings/ProceduralFairings.dll and /dev/null differ diff --git a/GameData/ProceduralFairings/README.md b/GameData/ProceduralFairings/README.md new file mode 100644 index 0000000..8bbdb5f --- /dev/null +++ b/GameData/ProceduralFairings/README.md @@ -0,0 +1,58 @@ +# Procedural Fairings + +Procedural Fairings mod for Kerbal Space Program. + +[Forum thread](http://forum.kerbalspaceprogram.com/index.php?/topic/36371-110-procedural-fairings-316-april-20/) + +[Download](https://github.com/e-dog/ProceduralFairings/releases) + +[License](http://creativecommons.org/licenses/by/3.0/) + + +## Installation +Remove old version of the mod. + +Copy ProceduralFairings into "Gamedata" in your KSP folder. + +## Installation Notes + +If you downloaded KSP from Squad's website, then the KSP folder is where you unzipped it when you first downloaded the game + +If you downloaded KSP from Steam, then right-clicking KSP in your Steam library, select "properties," switching to the "local files" tab, and pressing "browse local files" opens the game folder. + +In the KSP main folder a "GameData" folder contains all add-ons; without any add-ons, it contains only the "Squad" and "NASAMission" sub-folders - the stock "add-ons" from the developers of the game. Unzip the ProceduralFairings folder into your Gamedata folder. + +## Tutorial +[Pictures](http://imgur.com/a/xCF0q) + +### Steps +1. Put a fairing base under your payload (all Procedural Fairings parts are in the Aerodynamics tab) and a decoupler if necessary. +2. Attached fairings automatically reshape for your payload. +3. Enabling symmetry on fairings will encapsulate your payload +4. Rearrange stages to jettison fairings at the proper stage. + +### Inline Fairings +- Flipping another fairing base over and adding it above the payload will cause side fairings to stick to it instead of creating a nose cone, thereby creating inline fairings between two bases. +- Procedural Fairings includes low-profile base rings intended for inline fairings. + +### Controls +Right-click parts and use tweakables. + +## Career mode +Maximum (and minimum) part size is limited by tech. See GameData/ProceduralFairings/common.cfg for details. + +## Version history +**3.00** +- First release on GitHub. +- Moved files up to GameData folder (no Keramzit folder anymore). Make sure to delete old mod before installing (which is a good practice anyway). +- Added new resizable fairing bases with configurable number of side nodes. +- Old parts (bases and adapter) are deprecated. Launched vessels should be fine, but you might have trouble loading old designs in VAB/SPH in career mode. +- Added new part: Thrust Plate Multi-Adapter. +- Using KSPAPIExtensions by Swamp-Ig for better tweakables. +- Removed old keyboard-based tweaks - use new tweakables. +- Tweaking outer diameter (with fairings), instead of inner radius. +- Added fairing decoupler torque tweakable. +- Side nodes (for attaching fairings) get larger with the base size to make them more sturdy in KSP 0.23.5+ +- Tech limits are not checked in sandbox mode anymore. +- Extra payload radius is now zero by default. +- Fixed interstage adapter decoupling with fuselage fairings. diff --git a/GameData/ProceduralFairings/plugin/ProceduralFairings.dll b/GameData/ProceduralFairings/plugin/ProceduralFairings.dll new file mode 100644 index 0000000..edb88ec Binary files /dev/null and b/GameData/ProceduralFairings/plugin/ProceduralFairings.dll differ diff --git a/GameData/ProceduralFairings/adapter2.cfg b/GameData/ProceduralFairings/plugin/adapter2.cfg similarity index 100% rename from GameData/ProceduralFairings/adapter2.cfg rename to GameData/ProceduralFairings/plugin/adapter2.cfg diff --git a/GameData/ProceduralFairings/base.cfg b/GameData/ProceduralFairings/plugin/base.cfg similarity index 100% rename from GameData/ProceduralFairings/base.cfg rename to GameData/ProceduralFairings/plugin/base.cfg diff --git a/GameData/ProceduralFairings/baseModel.mu b/GameData/ProceduralFairings/plugin/baseModel.mu similarity index 100% rename from GameData/ProceduralFairings/baseModel.mu rename to GameData/ProceduralFairings/plugin/baseModel.mu diff --git a/GameData/ProceduralFairings/baseRing.cfg b/GameData/ProceduralFairings/plugin/baseRing.cfg similarity index 100% rename from GameData/ProceduralFairings/baseRing.cfg rename to GameData/ProceduralFairings/plugin/baseRing.cfg diff --git a/GameData/ProceduralFairings/baseRingModel.mu b/GameData/ProceduralFairings/plugin/baseRingModel.mu similarity index 100% rename from GameData/ProceduralFairings/baseRingModel.mu rename to GameData/ProceduralFairings/plugin/baseRingModel.mu diff --git a/GameData/ProceduralFairings/baseRingTex.dds b/GameData/ProceduralFairings/plugin/baseRingTex.dds similarity index 100% rename from GameData/ProceduralFairings/baseRingTex.dds rename to GameData/ProceduralFairings/plugin/baseRingTex.dds diff --git a/GameData/ProceduralFairings/baseTex.dds b/GameData/ProceduralFairings/plugin/baseTex.dds similarity index 100% rename from GameData/ProceduralFairings/baseTex.dds rename to GameData/ProceduralFairings/plugin/baseTex.dds diff --git a/GameData/ProceduralFairings/blackRingTex.dds b/GameData/ProceduralFairings/plugin/blackRingTex.dds similarity index 100% rename from GameData/ProceduralFairings/blackRingTex.dds rename to GameData/ProceduralFairings/plugin/blackRingTex.dds diff --git a/GameData/ProceduralFairings/common.cfg b/GameData/ProceduralFairings/plugin/common.cfg similarity index 100% rename from GameData/ProceduralFairings/common.cfg rename to GameData/ProceduralFairings/plugin/common.cfg diff --git a/GameData/ProceduralFairings/fairing1.dds b/GameData/ProceduralFairings/plugin/fairing1.dds similarity index 100% rename from GameData/ProceduralFairings/fairing1.dds rename to GameData/ProceduralFairings/plugin/fairing1.dds diff --git a/GameData/ProceduralFairings/fuselage1.cfg b/GameData/ProceduralFairings/plugin/fuselage1.cfg similarity index 100% rename from GameData/ProceduralFairings/fuselage1.cfg rename to GameData/ProceduralFairings/plugin/fuselage1.cfg diff --git a/GameData/ProceduralFairings/fuselage1.dds b/GameData/ProceduralFairings/plugin/fuselage1.dds similarity index 100% rename from GameData/ProceduralFairings/fuselage1.dds rename to GameData/ProceduralFairings/plugin/fuselage1.dds diff --git a/GameData/ProceduralFairings/fuselage2.cfg b/GameData/ProceduralFairings/plugin/fuselage2.cfg similarity index 100% rename from GameData/ProceduralFairings/fuselage2.cfg rename to GameData/ProceduralFairings/plugin/fuselage2.cfg diff --git a/GameData/ProceduralFairings/plate.cfg b/GameData/ProceduralFairings/plugin/plate.cfg similarity index 100% rename from GameData/ProceduralFairings/plate.cfg rename to GameData/ProceduralFairings/plugin/plate.cfg diff --git a/GameData/ProceduralFairings/side1.cfg b/GameData/ProceduralFairings/plugin/side1.cfg similarity index 100% rename from GameData/ProceduralFairings/side1.cfg rename to GameData/ProceduralFairings/plugin/side1.cfg diff --git a/GameData/ProceduralFairings/side2.cfg b/GameData/ProceduralFairings/plugin/side2.cfg similarity index 100% rename from GameData/ProceduralFairings/side2.cfg rename to GameData/ProceduralFairings/plugin/side2.cfg diff --git a/GameData/ProceduralFairings/sideModel.mu b/GameData/ProceduralFairings/plugin/sideModel.mu similarity index 100% rename from GameData/ProceduralFairings/sideModel.mu rename to GameData/ProceduralFairings/plugin/sideModel.mu diff --git a/GameData/ProceduralFairings/thrustPlate.mu b/GameData/ProceduralFairings/plugin/thrustPlate.mu similarity index 100% rename from GameData/ProceduralFairings/thrustPlate.mu rename to GameData/ProceduralFairings/plugin/thrustPlate.mu diff --git a/GameData/ProceduralFairings/thrustPlate1.dds b/GameData/ProceduralFairings/plugin/thrustPlate1.dds similarity index 100% rename from GameData/ProceduralFairings/thrustPlate1.dds rename to GameData/ProceduralFairings/plugin/thrustPlate1.dds diff --git a/GameData/ProceduralFairings/thrustPlate1bump_Normal_NRM.dds b/GameData/ProceduralFairings/plugin/thrustPlate1bump_Normal_NRM.dds similarity index 100% rename from GameData/ProceduralFairings/thrustPlate1bump_Normal_NRM.dds rename to GameData/ProceduralFairings/plugin/thrustPlate1bump_Normal_NRM.dds diff --git a/Source/FairingBase.cs b/Source/FairingBase.cs index 0b23105..22e12da 100644 --- a/Source/FairingBase.cs +++ b/Source/FairingBase.cs @@ -341,9 +341,11 @@ LineRenderer makeLineRenderer(string name, Color color, float wd) var r = o.AddComponent(); r.useWorldSpace = false; r.material = new Material(Shader.Find("Particles/Additive")); - r.SetColors(color, color); - r.SetWidth(wd, wd); - r.SetVertexCount(0); + r.startColor = color; + r.endColor = color; + r.startWidth = wd; + r.endWidth = wd; + r.positionCount = 0; return r; } @@ -621,7 +623,7 @@ void recalcShape() // fill profile outline (for debugging) if (line) { - line.SetVertexCount(scan.profile.Count * 2 + 2); + line.positionCount = scan.profile.Count * 2 + 2; float prevRad = 0; int hi = 0; @@ -791,7 +793,7 @@ void recalcShape() // no side parts - fill fairing outlines for (int j = 0; j < outline.Count; j++) { var lr = outline[j]; - lr.SetVertexCount(shape.Length); + lr.positionCount =shape.Length; for (int i = 0; i < shape.Length; ++i) lr.SetPosition(i, new Vector3(shape[i].x, shape[i].y)); @@ -801,7 +803,7 @@ void recalcShape() else { for (int j = 0; j < outline.Count; j++) { var lr = outline[j]; - lr.SetVertexCount(0); + lr.positionCount = 0; } } diff --git a/Source/FairingSide.cs b/Source/FairingSide.cs index a723d21..0eb2cf3 100644 --- a/Source/FairingSide.cs +++ b/Source/FairingSide.cs @@ -497,8 +497,14 @@ public void rebuildMesh() } m.triangles = tri; - - if (!HighLogic.LoadedSceneIsEditor) m.Optimize(); + + // The right way to call optimize on a mesh is to use the MeshUtility + // found in UnityEditor, but we don't seem to have a reference to that anywhere... + /* + if (!HighLogic.LoadedSceneIsEditor) { + MeshUtility.Optimize(m); + } + */ StartCoroutine(PFUtils.updateDragCubeCoroutine(part, 1)); } diff --git a/Source/PFKMJoint.cs b/Source/PFKMJoint.cs index 28340ea..45a874b 100644 --- a/Source/PFKMJoint.cs +++ b/Source/PFKMJoint.cs @@ -141,7 +141,7 @@ public virtual void FixedUpdate() private LineRenderer JointLine(Vector3 posp, Vector3 pospp, Color col, float width) { LineRenderer lineRenderer = this.makeLineRenderer("JointLine", col, width); - lineRenderer.SetVertexCount(2); + lineRenderer.positionCount = 2; lineRenderer.SetPosition(0, posp); lineRenderer.SetPosition(1, pospp); lineRenderer.useWorldSpace = true; @@ -279,9 +279,11 @@ private LineRenderer makeLineRenderer(string name, Color color, float wd) LineRenderer lineRenderer = gameObject.AddComponent(); lineRenderer.useWorldSpace = true; lineRenderer.material = new Material(Shader.Find("Particles/Additive")); - lineRenderer.SetColors(color, color); - lineRenderer.SetWidth(wd, wd); - lineRenderer.SetVertexCount(0); + lineRenderer.startColor = color; + lineRenderer.endColor = color; + lineRenderer.startWidth = wd; + lineRenderer.endWidth = wd; + lineRenderer.positionCount = 0; return lineRenderer; } diff --git a/Source/ProceduralFairings.csproj b/Source/ProceduralFairings.csproj index 3131469..7f20490 100644 --- a/Source/ProceduralFairings.csproj +++ b/Source/ProceduralFairings.csproj @@ -32,7 +32,7 @@ False - C:\Users\caske\Downloads\ksp-win64-1.3\KSP_win64\KSP_x64_Data\Managed\Assembly-CSharp.dll + ..\..\Dependencies\1.4.3\Assembly-CSharp.dll @@ -42,7 +42,7 @@ False - C:\Users\caske\Downloads\ksp-win64-1.3\KSP_win64\KSP_x64_Data\Managed\UnityEngine.dll + ..\..\Dependencies\1.4.3\UnityEngine.dll diff --git a/Source/Properties/AssemblyInfo.cs b/Source/Properties/AssemblyInfo.cs index 3ad1ed9..25a6985 100644 --- a/Source/Properties/AssemblyInfo.cs +++ b/Source/Properties/AssemblyInfo.cs @@ -6,11 +6,11 @@ // Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, // die mit einer Assembly verknüpft sind. [assembly: AssemblyTitle("ProceduralFairings")] -[assembly: AssemblyDescription("Procedural Fairings 4.0 for KSP 1.3")] +[assembly: AssemblyDescription("Procedural Fairings 4.0 for KSP 1.3.1")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("ProceduralFairings.Properties")] -[assembly: AssemblyCopyright("Copyright © 2017")] +[assembly: AssemblyCopyright("Copyright © 2018")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -29,5 +29,5 @@ // Buildnummer // Revision // -[assembly: AssemblyVersion("0.0.4.0")] -[assembly: AssemblyFileVersion("0.0.4.0")] +[assembly: AssemblyVersion("0.0.5.0")] +[assembly: AssemblyFileVersion("0.0.5.0")]