diff --git a/FerramAerospaceResearch.v12.suo b/FerramAerospaceResearch.v12.suo index dc6fefea8..9607823c6 100644 Binary files a/FerramAerospaceResearch.v12.suo and b/FerramAerospaceResearch.v12.suo differ diff --git a/FerramAerospaceResearch/CompatibilityChecker.cs b/FerramAerospaceResearch/CompatibilityChecker.cs index 67c8cd722..41c8669ad 100644 --- a/FerramAerospaceResearch/CompatibilityChecker.cs +++ b/FerramAerospaceResearch/CompatibilityChecker.cs @@ -1,25 +1,26 @@ -/** + +/** * Copyright (c) 2014, Majiir * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are permitted + * + * Redistribution and use in source and binary forms, with or without modification, are permitted * provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of + * + * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other materials provided + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list of + * conditions and the following disclaimer in the documentation and/or other materials provided * with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ @@ -38,7 +39,7 @@ namespace ferram4 /** * This utility displays a warning with a list of mods that determine themselves * to be incompatible with the current running version of Kerbal Space Program. - * + * * See this forum thread for details: * http://forum.kerbalspaceprogram.com/threads/65395-Voluntarily-Locking-Plugins-to-a-Particular-KSP-Version */ @@ -61,10 +62,10 @@ public static bool IsCompatible() // ...disable some features... // } // - // Even if you don't lock down functionality, you should return true if your users + // Even if you don't lock down functionality, you should return true if your users // can expect a future update to be available. // - return Versioning.version_major == 0 && Versioning.version_minor == 24 && (Versioning.Revision == 1 || Versioning.Revision == 2); + return Versioning.version_minor == 25; /*-----------------------------------------------*\ | IMPLEMENTERS SHOULD NOT EDIT BEYOND THIS POINT! | @@ -79,9 +80,7 @@ public static bool IsUnityCompatible() // TODO: Implement your own Unity compatibility check. // - bool compat = Application.unityVersion == "4.3.3f1"; //Mac / Linux - compat |= Application.unityVersion == "4.5.2f1"; //Windows - return compat; + return true; /*-----------------------------------------------*\ | IMPLEMENTERS SHOULD NOT EDIT BEYOND THIS POINT! | @@ -89,7 +88,7 @@ public static bool IsUnityCompatible() } // Version of the compatibility checker itself. - private static int _version = 3; + private static int _version = 4; public void Start() { @@ -159,28 +158,48 @@ public void Start() Array.Sort(incompatible); Array.Sort(incompatibleUnity); - String message = "Some installed mods may be incompatible with this version of Kerbal Space Program. Features may be broken or disabled. Please check for updates to the listed mods."; + String message = String.Empty; - if (incompatible.Length > 0) + if (IsWin64()) { - Debug.LogWarning("[CompatibilityChecker] Incompatible mods detected: " + String.Join(", ", incompatible)); - message += String.Format("\n\nThese mods are incompatible with KSP {0}.{1}.{2}:\n\n", Versioning.version_major, Versioning.version_minor, Versioning.Revision); - message += String.Join("\n", incompatible); + message += "WARNING: You are using 64-bit KSP on Windows. This version of KSP is known to cause crashes. It's highly recommended that you use either 32-bit KSP on Windows or switch to Linux."; } - if (incompatibleUnity.Length > 0) + if ((incompatible.Length > 0) || (incompatibleUnity.Length > 0)) { - Debug.LogWarning("[CompatibilityChecker] Incompatible mods (Unity) detected: " + String.Join(", ", incompatibleUnity)); - message += String.Format("\n\nThese mods are incompatible with Unity {0}:\n\n", Application.unityVersion); - message += String.Join("\n", incompatibleUnity); + message += ((message == String.Empty) ? "Some" : "\n\nAdditionally, some") + " installed mods may be incompatible with this version of Kerbal Space Program. Features may be broken or disabled. Please check for updates to the listed mods."; + + if (incompatible.Length > 0) + { + Debug.LogWarning("[CompatibilityChecker] Incompatible mods detected: " + String.Join(", ", incompatible)); + message += String.Format("\n\nThese mods are incompatible with KSP {0}.{1}.{2}:\n\n", Versioning.version_major, Versioning.version_minor, Versioning.Revision); + message += String.Join("\n", incompatible); + } + + if (incompatibleUnity.Length > 0) + { + Debug.LogWarning("[CompatibilityChecker] Incompatible mods (Unity) detected: " + String.Join(", ", incompatibleUnity)); + message += String.Format("\n\nThese mods are incompatible with Unity {0}:\n\n", Application.unityVersion); + message += String.Join("\n", incompatibleUnity); + } } - if ((incompatible.Length > 0) || (incompatibleUnity.Length > 0)) + if ((incompatible.Length > 0) || (incompatibleUnity.Length > 0) || IsWin64()) { PopupDialog.SpawnPopupDialog("Incompatible Mods Detected", message, "OK", true, HighLogic.Skin); } } + public static bool IsWin64() + { + return (IntPtr.Size == 8) && (Environment.OSVersion.Platform == PlatformID.Win32NT); + } + + public static bool IsAllCompatible() + { + return IsCompatible() && IsUnityCompatible() && !IsWin64(); + } + private static IEnumerable getAllTypes() { foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies()) diff --git a/FerramAerospaceResearch/FARAPI.cs b/FerramAerospaceResearch/FARAPI.cs index 70f773316..131474f97 100644 --- a/FerramAerospaceResearch/FARAPI.cs +++ b/FerramAerospaceResearch/FARAPI.cs @@ -1,5 +1,5 @@ /* -Ferram Aerospace Research v0.14.1.2 +Ferram Aerospace Research v0.14.2 Copyright 2014, Michael Ferrara, aka Ferram4 This file is part of Ferram Aerospace Research. diff --git a/FerramAerospaceResearch/FARAction.cs b/FerramAerospaceResearch/FARAction.cs index 0bd48d3aa..8bcd0f7d0 100644 --- a/FerramAerospaceResearch/FARAction.cs +++ b/FerramAerospaceResearch/FARAction.cs @@ -1,5 +1,5 @@ /* -Ferram Aerospace Research v0.14.1.2 +Ferram Aerospace Research v0.14.2 Copyright 2014, Michael Ferrara, aka Ferram4 This file is part of Ferram Aerospace Research. diff --git a/FerramAerospaceResearch/FARAeroStress.cs b/FerramAerospaceResearch/FARAeroStress.cs index 38eb08b6e..2a02f9dc7 100644 --- a/FerramAerospaceResearch/FARAeroStress.cs +++ b/FerramAerospaceResearch/FARAeroStress.cs @@ -1,5 +1,5 @@ /* -Ferram Aerospace Research v0.14.1.2 +Ferram Aerospace Research v0.14.2 Copyright 2014, Michael Ferrara, aka Ferram4 This file is part of Ferram Aerospace Research. diff --git a/FerramAerospaceResearch/FARAeroUtil.cs b/FerramAerospaceResearch/FARAeroUtil.cs index 92a221eae..0fe046e71 100644 --- a/FerramAerospaceResearch/FARAeroUtil.cs +++ b/FerramAerospaceResearch/FARAeroUtil.cs @@ -1,5 +1,5 @@ /* -Ferram Aerospace Research v0.14.1.2 +Ferram Aerospace Research v0.14.2 Copyright 2014, Michael Ferrara, aka Ferram4 This file is part of Ferram Aerospace Research. diff --git a/FerramAerospaceResearch/FARBaseAerodynamics.cs b/FerramAerospaceResearch/FARBaseAerodynamics.cs index c4f1cd3de..da41ef30f 100644 --- a/FerramAerospaceResearch/FARBaseAerodynamics.cs +++ b/FerramAerospaceResearch/FARBaseAerodynamics.cs @@ -1,5 +1,5 @@ /* -Ferram Aerospace Research v0.14.1.2 +Ferram Aerospace Research v0.14.2 Copyright 2014, Michael Ferrara, aka Ferram4 This file is part of Ferram Aerospace Research. @@ -95,8 +95,6 @@ public override void Start() { Fields["Cl"].guiActive = Fields["Cd"].guiActive = Fields["Cm"].guiActive = FARDebugValues.displayCoefficients; } - - FARGUIUtils.defaultHighlightColor = part.highlightColor; } public virtual void LateUpdate() @@ -108,9 +106,9 @@ public virtual void LateUpdate() bool active = FARControlSys.tintForCl || FARControlSys.tintForCd; if (FARControlSys.tintForCl) - satCl = (float)FARMathUtil.Clamp(Math.Abs(this.Cl / FARControlSys.fullySaturatedCl), 0, 1) * 255; + satCl = (float)Math.Abs(this.Cl / FARControlSys.fullySaturatedCl) * 10; if (FARControlSys.tintForCd) - satCd = (float)FARMathUtil.Clamp(Math.Abs(this.Cd / FARControlSys.fullySaturatedCd), 0, 1) * 255; + satCd = (float)Math.Abs(this.Cd / FARControlSys.fullySaturatedCd) * 10; Color tintColor = new Color(satCd, 0.5f * (satCl + satCd), satCl, 1); @@ -118,12 +116,13 @@ public virtual void LateUpdate() { this.part.SetHighlightType(Part.HighlightType.AlwaysOn); this.part.SetHighlightColor(tintColor); + this.part.highlightRecurse = false; this.part.SetHighlight(true); } else if (part.highlightType != Part.HighlightType.OnMouseOver) { this.part.SetHighlightType(Part.HighlightType.OnMouseOver); - this.part.SetHighlightColor(FARGUIUtils.defaultHighlightColor); + this.part.SetHighlightColor(Part.defaultHighlightPart); this.part.SetHighlight(false); } } @@ -268,8 +267,8 @@ public void OnCenterOfLiftQuery(CenterOfLiftQuery CoLMarker) // Feed the precomputed values to the vanilla indicator CoLMarker.pos = GlobalCoL; - CoLMarker.dir = CoLForce.normalized; - CoLMarker.lift = CoLForce.magnitude * 50f; + CoLMarker.dir = Vector3.zero; + CoLMarker.lift = CoLForce.magnitude; } public override void OnLoad(ConfigNode node) diff --git a/FerramAerospaceResearch/FARBasicDragModel.cs b/FerramAerospaceResearch/FARBasicDragModel.cs index 19aa0bbc3..868051635 100644 --- a/FerramAerospaceResearch/FARBasicDragModel.cs +++ b/FerramAerospaceResearch/FARBasicDragModel.cs @@ -1,5 +1,5 @@ /* -Ferram Aerospace Research v0.14.1.2 +Ferram Aerospace Research v0.14.2 Copyright 2014, Michael Ferrara, aka Ferram4 This file is part of Ferram Aerospace Research. @@ -208,7 +208,7 @@ public override void Start() OnVesselPartsChange += AttachNodeCdAdjust; - UpdateUpVector(false); + UpdateUpVector(false || this.part.Modules.Contains("ModuleResourceIntake")); //PartModelTransforms = FARGeoUtil.PartModelTransformArray(part); AttachNodeCdAdjust(); AnimationSetup(); diff --git a/FerramAerospaceResearch/FARCargoBayModule.cs b/FerramAerospaceResearch/FARCargoBayModule.cs index b84719f21..d6dc2947c 100644 --- a/FerramAerospaceResearch/FARCargoBayModule.cs +++ b/FerramAerospaceResearch/FARCargoBayModule.cs @@ -1,5 +1,5 @@ /* -Ferram Aerospace Research v0.14.1.2 +Ferram Aerospace Research v0.14.2 Copyright 2014, Michael Ferrara, aka Ferram4 This file is part of Ferram Aerospace Research. @@ -252,6 +252,18 @@ private void FindShieldedParts() double y_margin = Math.Max(0.12, 0.03 * (maxBounds.y-minBounds.y)); + Collider[] colliders; + try + { + colliders = part.GetComponentsInChildren(); + } + catch (Exception e) + { + //Fail silently because it's the only way to avoid issues with pWings + //Debug.LogException(e); + colliders = new Collider[1] { part.collider }; + } + for (int i = 0; i < VesselPartList.Count; i++) { Part p = VesselPartList[i]; @@ -293,6 +305,22 @@ private void FindShieldedParts() p.parent == this.part && p.attachMode == AttachModes.STACK) continue; } + Vector3 vecFromPToCargoBayCenter = this.part.partTransform.position - p.partTransform.position; + + RaycastHit[] hits = Physics.RaycastAll(p.partTransform.position, vecFromPToCargoBayCenter, vecFromPToCargoBayCenter.magnitude, FARAeroUtil.RaycastMask); + + bool outsideMesh = false; + + for (int j = 0; j < hits.Length; j++) + { + if (colliders.Contains(hits[j].collider)) + { + outsideMesh = true; + break; + } + } + if (outsideMesh) + break; FARShieldedParts.Add(p); if (b) diff --git a/FerramAerospaceResearch/FARCenterQuery.cs b/FerramAerospaceResearch/FARCenterQuery.cs index f20b681c8..1accf802b 100644 --- a/FerramAerospaceResearch/FARCenterQuery.cs +++ b/FerramAerospaceResearch/FARCenterQuery.cs @@ -1,5 +1,5 @@ /* -Ferram Aerospace Research v0.14.1.2 +Ferram Aerospace Research v0.14.2 Copyright 2014, Michael Ferrara, aka Ferram4 This file is part of Ferram Aerospace Research. diff --git a/FerramAerospaceResearch/FARControlSys.cs b/FerramAerospaceResearch/FARControlSys.cs index d8cef0bc8..c85f946b7 100644 --- a/FerramAerospaceResearch/FARControlSys.cs +++ b/FerramAerospaceResearch/FARControlSys.cs @@ -1,5 +1,5 @@ /* -Ferram Aerospace Research v0.14.1.2 +Ferram Aerospace Research v0.14.2 Copyright 2014, Michael Ferrara, aka Ferram4 This file is part of Ferram Aerospace Research. @@ -874,10 +874,10 @@ private void AutopilotWindowGUI(int windowID) GUILayout.BeginHorizontal(GUILayout.ExpandWidth(true)); GUILayout.Label("k:", GUILayout.Width(30)); k_wingleveler_str = GUILayout.TextField(k_wingleveler_str, GUILayout.ExpandWidth(true)); - k_wingleveler_str = Regex.Replace(k_wingleveler_str, @"[^-?\d*\.?\d*]", ""); + k_wingleveler_str = Regex.Replace(k_wingleveler_str, @"[^-?[0-9]*(\.[0-9]*)?]", ""); GUILayout.Label("kd:", GUILayout.Width(30)); kd_wingleveler_str = GUILayout.TextField(kd_wingleveler_str, GUILayout.ExpandWidth(true)); - kd_wingleveler_str = Regex.Replace(kd_wingleveler_str, @"[^-?\d*\.?\d*]", ""); + kd_wingleveler_str = Regex.Replace(kd_wingleveler_str, @"[^-?[0-9]*(\.[0-9]*)?]", ""); GUILayout.EndHorizontal(); @@ -886,14 +886,14 @@ private void AutopilotWindowGUI(int windowID) GUILayout.BeginHorizontal(GUILayout.ExpandWidth(true)); GUILayout.Label("k:", GUILayout.Width(30)); k_yawdamper_str = GUILayout.TextField(k_yawdamper_str, GUILayout.ExpandWidth(true)); - k_yawdamper_str = Regex.Replace(k_yawdamper_str, @"[^-?\d*\.?\d*]", ""); + k_yawdamper_str = Regex.Replace(k_yawdamper_str, @"[^-?[0-9]*(\.[0-9]*)?]", ""); GUILayout.EndHorizontal(); GUILayout.Box("Pitch Damper", mySty, GUILayout.ExpandWidth(true)); GUILayout.BeginHorizontal(GUILayout.ExpandWidth(true)); GUILayout.Label("k:", GUILayout.Width(30)); k_pitchdamper_str = GUILayout.TextField(k_pitchdamper_str, GUILayout.ExpandWidth(true)); - k_pitchdamper_str = Regex.Replace(k_pitchdamper_str, @"[^-?\d*\.?\d*]", ""); + k_pitchdamper_str = Regex.Replace(k_pitchdamper_str, @"[^-?[0-9]*(\.[0-9]*)?]", ""); GUILayout.EndHorizontal(); @@ -902,16 +902,16 @@ private void AutopilotWindowGUI(int windowID) GUILayout.BeginHorizontal(GUILayout.ExpandWidth(true)); GUILayout.Label("Upper Lim:", GUILayout.Width(75)); upperLim_str = GUILayout.TextField(upperLim_str, GUILayout.ExpandWidth(true)); - upperLim_str = Regex.Replace(upperLim_str, @"[^-?\d*\.?\d*]", ""); + upperLim_str = Regex.Replace(upperLim_str, @"[^-?[0-9]*(\.[0-9]*)?]", ""); GUILayout.Label("Lower Lim:", GUILayout.Width(75)); lowerLim_str = GUILayout.TextField(lowerLim_str, GUILayout.ExpandWidth(true)); - lowerLim_str = Regex.Replace(lowerLim_str, @"[^-?\d*\.?\d*]", ""); + lowerLim_str = Regex.Replace(lowerLim_str, @"[^-?[0-9]*(\.[0-9]*)?]", ""); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(GUILayout.ExpandWidth(true)); GUILayout.Label("k:", GUILayout.Width(30)); k_limiter_str = GUILayout.TextField(k_limiter_str, GUILayout.ExpandWidth(true)); - k_limiter_str = Regex.Replace(k_limiter_str, @"[^-?\d*\.?\d*]", ""); + k_limiter_str = Regex.Replace(k_limiter_str, @"[^-?[0-9]*(\.[0-9]*)?]", ""); GUILayout.EndHorizontal(); @@ -921,14 +921,14 @@ private void AutopilotWindowGUI(int windowID) GUILayout.BeginHorizontal(GUILayout.ExpandWidth(true)); GUILayout.Label("Scaling Velocity:", GUILayout.Width(100)); scaleVelocity_str = GUILayout.TextField(scaleVelocity_str, GUILayout.ExpandWidth(true)); - scaleVelocity_str = Regex.Replace(scaleVelocity_str, @"[^-?\d*\.?\d*]", ""); + scaleVelocity_str = Regex.Replace(scaleVelocity_str, @"[^-?[0-9]*(\.[0-9]*)?]", ""); GUILayout.Label("Ctrl Factor:", GUILayout.Width(80)); GUILayout.Box(scalingfactor.ToString("N4"), mySty, GUILayout.Width(90.0F), GUILayout.Height(30.0F)); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(GUILayout.ExpandWidth(true)); GUILayout.Label("Scaling Altitude:", GUILayout.Width(100)); alt_str = GUILayout.TextField(alt_str, GUILayout.ExpandWidth(true)); - alt_str = Regex.Replace(alt_str, @"[^-?\d*\.?\d*]", ""); + alt_str = Regex.Replace(alt_str, @"[^-?[0-9]*(\.[0-9]*)?]", ""); GUILayout.EndHorizontal(); @@ -1176,12 +1176,12 @@ private void AeroForceTintingGUI(int windowID) string tmp = fullySaturatedCl.ToString(); FARGUIUtils.TextEntryField("Cl For Full Tint:", 80, ref tmp); - tmp = Regex.Replace(tmp, @"[^-?\d*\.?\d*]", ""); + tmp = Regex.Replace(tmp, @"[^\d+-\.]", ""); fullySaturatedCl = double.Parse(tmp); tmp = fullySaturatedCd.ToString(); FARGUIUtils.TextEntryField("Cd For Full Tint:", 80, ref tmp); - tmp = Regex.Replace(tmp, @"[^-?\d*\.?\d*]", ""); + tmp = Regex.Replace(tmp, @"[^\d+-\.]", ""); fullySaturatedCd = double.Parse(tmp); GUI.DragWindow(); @@ -1250,7 +1250,7 @@ public void OnGUI() GUI.skin = HighLogic.Skin; if (this == activeControlSys && !minimize && !hide) { - windowPos = GUILayout.Window(250, windowPos, WindowGUI, "FAR Flight Systems, v0.14.1.2", GUILayout.MinWidth(150)); + windowPos = GUILayout.Window(250, windowPos, WindowGUI, "FAR Flight Systems, v0.14.2", GUILayout.MinWidth(150)); if (AutopilotWindow) { AutoPilotWindowPos = GUILayout.Window(251, AutoPilotWindowPos, AutopilotWindowGUI, "FAR Flight Assistance System Options", GUILayout.MinWidth(330)); @@ -1271,7 +1271,7 @@ public void OnGUI() } if(AeroForceTintingWindow) { - AeroForceTintingPos = GUILayout.Window(257, AeroForceTintingPos, AeroForceTintingGUI, "FAR Aero Force Visualization", GUILayout.MinWidth(200)); + AeroForceTintingPos = GUILayout.Window(257, AeroForceTintingPos, AeroForceTintingGUI, "FAR Force Visualization", GUILayout.MinWidth(200)); } } diff --git a/FerramAerospaceResearch/FARControllableSurface.cs b/FerramAerospaceResearch/FARControllableSurface.cs index f993460e3..488ca2bc2 100644 --- a/FerramAerospaceResearch/FARControllableSurface.cs +++ b/FerramAerospaceResearch/FARControllableSurface.cs @@ -1,5 +1,5 @@ /* -Ferram Aerospace Research v0.14.1.2 +Ferram Aerospace Research v0.14.2 Copyright 2014, Michael Ferrara, aka Ferram4 This file is part of Ferram Aerospace Research. diff --git a/FerramAerospaceResearch/FARDebugOptions.cs b/FerramAerospaceResearch/FARDebugOptions.cs index 17b096695..0381946fd 100644 --- a/FerramAerospaceResearch/FARDebugOptions.cs +++ b/FerramAerospaceResearch/FARDebugOptions.cs @@ -1,5 +1,5 @@ /* -Ferram Aerospace Research v0.14.1.2 +Ferram Aerospace Research v0.14.2 Copyright 2014, Michael Ferrara, aka Ferram4 This file is part of Ferram Aerospace Research. @@ -130,7 +130,7 @@ public void OnGUI() { GUI.skin = HighLogic.Skin; if (debugMenu) - debugWinPos = GUILayout.Window("FARDebug".GetHashCode(), debugWinPos, debugWindow, "FAR Debug Options, v0.14.1.2", GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true)); + debugWinPos = GUILayout.Window("FARDebug".GetHashCode(), debugWinPos, debugWindow, "FAR Debug Options, v0.14.2", GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true)); } @@ -170,8 +170,6 @@ private void debugWindow(int windowID) // SaveWindowPos.y = windowPos.y; GUI.DragWindow(); - - debugWinPos.height = 250; debugWinPos = FARGUIUtils.ClampToScreen(debugWinPos); } @@ -184,32 +182,32 @@ private void AeroDataTab(GUIStyle buttonStyle, GUIStyle boxStyle) tmp = FARAeroUtil.areaFactor.ToString(); FARGUIUtils.TextEntryField("Area Factor:", 160, ref tmp); - tmp = Regex.Replace(tmp, @"[^-?\d*\.?\d*]", ""); + tmp = Regex.Replace(tmp, @"[^\d+-\.]", ""); FARAeroUtil.areaFactor = Convert.ToDouble(tmp); tmp = (FARAeroUtil.attachNodeRadiusFactor * 2).ToString(); FARGUIUtils.TextEntryField("Node Diameter Factor:", 160, ref tmp); - tmp = Regex.Replace(tmp, @"[^-?\d*\.?\d*]", ""); + tmp = Regex.Replace(tmp, @"[^\d+-\.]", ""); FARAeroUtil.attachNodeRadiusFactor = Convert.ToDouble(tmp) * 0.5; tmp = FARAeroUtil.incompressibleRearAttachDrag.ToString(); FARGUIUtils.TextEntryField("Rear Node Drag, Incomp:", 160, ref tmp); - tmp = Regex.Replace(tmp, @"[^-?\d*\.?\d*]", ""); + tmp = Regex.Replace(tmp, @"[^\d+-\.]", ""); FARAeroUtil.incompressibleRearAttachDrag = Convert.ToDouble(tmp); tmp = FARAeroUtil.sonicRearAdditionalAttachDrag.ToString(); FARGUIUtils.TextEntryField("Rear Node Drag, M = 1:", 160, ref tmp); - tmp = Regex.Replace(tmp, @"[^-?\d*\.?\d*]", ""); + tmp = Regex.Replace(tmp, @"[^\d+-\.]", ""); FARAeroUtil.sonicRearAdditionalAttachDrag = Convert.ToDouble(tmp); tmp = FARControllableSurface.timeConstant.ToString(); FARGUIUtils.TextEntryField("Ctrl Surf Time Constant:", 160, ref tmp); - tmp = Regex.Replace(tmp, @"[^-?\d*\.?\d*]", ""); + tmp = Regex.Replace(tmp, @"[^\d+-\.]", ""); FARControllableSurface.timeConstant = Convert.ToDouble(tmp); tmp = FARControllableSurface.timeConstantFlap.ToString(); FARGUIUtils.TextEntryField("Flap/Spoiler Time Constant:", 160, ref tmp); - tmp = Regex.Replace(tmp, @"[^-?\d*\.?\d*]", ""); + tmp = Regex.Replace(tmp, @"[^\d+-\.]", ""); FARControllableSurface.timeConstantFlap = Convert.ToDouble(tmp); GUILayout.EndVertical(); @@ -217,7 +215,7 @@ private void AeroDataTab(GUIStyle buttonStyle, GUIStyle boxStyle) GUILayout.Label("Celestial Body Atmosperic Properties"); GUILayout.BeginHorizontal(); - + GUILayout.BeginVertical(boxStyle); GUILayout.BeginHorizontal(); @@ -250,14 +248,14 @@ private void AeroDataTab(GUIStyle buttonStyle, GUIStyle boxStyle) tmp = atmProperties.y.ToString(); FARGUIUtils.TextEntryField("Ratio of Specific Heats:", 80, ref tmp); - tmp = Regex.Replace(tmp, @"[^-?\d*\.?\d*]", ""); + tmp = Regex.Replace(tmp, @"[^\d+-\.]", ""); atmProperties.y = Convert.ToDouble(tmp); double dTmp = 8314.5 / atmProperties.z; tmp = dTmp.ToString(); FARGUIUtils.TextEntryField("Gas Molecular Mass:", 80, ref tmp); - tmp = Regex.Replace(tmp, @"[^-?\d*\.?\d*]", ""); + tmp = Regex.Replace(tmp, @"[^\d+-\.]", ""); atmProperties.z = 8314.5 / Convert.ToDouble(tmp); atmProperties.x = atmProperties.y * atmProperties.z; @@ -324,19 +322,19 @@ private void AeroStressTab(GUIStyle buttonStyle, GUIStyle boxStyle) tmp = activeTemplate.YmaxStress.ToString(); FARGUIUtils.TextEntryField("Axial (Y-axis) Max Stress:", 240, ref tmp); - tmp = Regex.Replace(tmp, @"[^-?\d*\.?\d*]", ""); + tmp = Regex.Replace(tmp, @"[^\d+-\.]", ""); activeTemplate.YmaxStress = Convert.ToDouble(tmp); tmp = activeTemplate.XZmaxStress.ToString(); FARGUIUtils.TextEntryField("Lateral (X,Z-axis) Max Stress:", 240, ref tmp); - tmp = Regex.Replace(tmp, @"[^-?\d*\.?\d*]", ""); + tmp = Regex.Replace(tmp, @"[^\d+-\.]", ""); activeTemplate.XZmaxStress = Convert.ToDouble(tmp); activeTemplate.crewed = GUILayout.Toggle(activeTemplate.crewed, "Requires Crew Compartment"); tmp = activeTemplate.minNumResources.ToString(); FARGUIUtils.TextEntryField("Min Num Resources:", 80, ref tmp); - tmp = Regex.Replace(tmp, @"[^-?\d*\.?\d*]", ""); + tmp = Regex.Replace(tmp, @"[^\d+-\.]", ""); activeTemplate.minNumResources = Convert.ToInt32(tmp); GUILayout.Label("Req Resources:"); diff --git a/FerramAerospaceResearch/FAREditorGUI.cs b/FerramAerospaceResearch/FAREditorGUI.cs index cab3613fa..1c73a264b 100644 --- a/FerramAerospaceResearch/FAREditorGUI.cs +++ b/FerramAerospaceResearch/FAREditorGUI.cs @@ -1,5 +1,5 @@ /* -Ferram Aerospace Research v0.14.1.2 +Ferram Aerospace Research v0.14.2 Copyright 2014, Michael Ferrara, aka Ferram4 This file is part of Ferram Aerospace Research. @@ -224,7 +224,7 @@ public void OnGUI() if (!minimize && !hide) { - windowPos = GUILayout.Window(256, windowPos, ActualGUI, "FAR Control & Analysis Systems, v0.14.1.2"); + windowPos = GUILayout.Window(256, windowPos, ActualGUI, "FAR Control & Analysis Systems, v0.14.2"); if (AnalysisHelp) { analysisHelpPos = GUILayout.Window(258, analysisHelpPos, AnalysisHelpGUI, "FAR Analysis Systems Help", GUILayout.Width(400), GUILayout.Height(Screen.height / 3)); @@ -570,12 +570,12 @@ private void SimulationGUI(bool tmp) dT = GUILayout.TextField(dT, GUILayout.ExpandWidth(true)); if (GUILayout.Button("Run Simulation", ButtonStyle, GUILayout.Width(150.0F), GUILayout.Height(25.0F))) { - u_init = Regex.Replace(u_init, @"[^-?\d*\.?\d*]", ""); - w_init = Regex.Replace(w_init, @"[^-?\d*\.?\d*]", ""); - q_init = Regex.Replace(q_init, @"[^-?\d*\.?\d*]", ""); - θ_init = Regex.Replace(θ_init, @"[^-?\d*\.?\d*]", ""); - time_end = Regex.Replace(time_end, @"[^-?\d*\.?\d*]", ""); - dT = Regex.Replace(dT, @"[^-?\d*\.?\d*]", ""); + u_init = Regex.Replace(u_init, @"[^-?[0-9]*(\.[0-9]*)?]", ""); + w_init = Regex.Replace(w_init, @"[^-?[0-9]*(\.[0-9]*)?]", ""); + q_init = Regex.Replace(q_init, @"[^-?[0-9]*(\.[0-9]*)?]", ""); + θ_init = Regex.Replace(θ_init, @"[^-?[0-9]*(\.[0-9]*)?]", ""); + time_end = Regex.Replace(time_end, @"[^-?[0-9]*(\.[0-9]*)?]", ""); + dT = Regex.Replace(dT, @"[^-?[0-9]*(\.[0-9]*)?]", ""); double[] InitCond = new double[4] { Convert.ToDouble(w_init), Convert.ToDouble(u_init), Convert.ToDouble(q_init) * Math.PI / 180, Convert.ToDouble(θ_init) * Math.PI / 180 }; RunTransientSimLongitudinal(Convert.ToDouble(time_end), Convert.ToDouble(dT), InitCond); } @@ -627,12 +627,12 @@ private void SimulationGUI(bool tmp) dT = GUILayout.TextField(dT, GUILayout.ExpandWidth(true)); if (GUILayout.Button("Run Simulation", ButtonStyle, GUILayout.Width(150.0F), GUILayout.Height(25.0F))) { - beta_init = Regex.Replace(beta_init, @"[^-?\d*\.?\d*]", ""); - r_init = Regex.Replace(r_init, @"[^-?\d*\.?\d*]", ""); - p_init = Regex.Replace(p_init, @"[^-?\d*\.?\d*]", ""); - φ_init = Regex.Replace(φ_init, @"[^-?\d*\.?\d*]", ""); - time_end = Regex.Replace(time_end, @"[^-?\d*\.?\d*]", ""); - dT = Regex.Replace(dT, @"[^-?\d*\.?\d*]", ""); + beta_init = Regex.Replace(beta_init, @"[^-?[0-9]*(\.[0-9]*)?]", ""); + r_init = Regex.Replace(r_init, @"[^-?[0-9]*(\.[0-9]*)?]", ""); + p_init = Regex.Replace(p_init, @"[^-?[0-9]*(\.[0-9]*)?]", ""); + φ_init = Regex.Replace(φ_init, @"[^-?[0-9]*(\.[0-9]*)?]", ""); + time_end = Regex.Replace(time_end, @"[^-?[0-9]*(\.[0-9]*)?]", ""); + dT = Regex.Replace(dT, @"[^-?[0-9]*(\.[0-9]*)?]", ""); double[] InitCond = new double[4] { Convert.ToDouble(beta_init) * Math.PI / 180, Convert.ToDouble(p_init) * Math.PI / 180, Convert.ToDouble(r_init) * Math.PI / 180, Convert.ToDouble(φ_init) * Math.PI / 180 }; RunTransientSimLateral(Convert.ToDouble(time_end), Convert.ToDouble(dT), InitCond); } @@ -952,9 +952,9 @@ private void StabilityDerivativeGUI(bool tmp) if (GUILayout.Button("Calculate Stability Derivatives", ButtonStyle, GUILayout.Width(250.0F), GUILayout.Height(25.0F))) { FARAeroUtil.UpdateCurrentActiveBody(index, FlightGlobals.Bodies[1]); - atm_temp_str = Regex.Replace(atm_temp_str, @"[^-?\d*\.?\d*]", ""); - rho_str = Regex.Replace(rho_str, @"[^-?\d*\.?\d*]", ""); - Mach_str = Regex.Replace(Mach_str, @"[^-?\d*\.?\d*]", ""); + atm_temp_str = Regex.Replace(atm_temp_str, @"[^-?[0-9]*(\.[0-9]*)?]", ""); + rho_str = Regex.Replace(rho_str, @"[^-?[0-9]*(\.[0-9]*)?]", ""); + Mach_str = Regex.Replace(Mach_str, @"[^-?[0-9]*(\.[0-9]*)?]", ""); double temp = Convert.ToSingle(atm_temp_str); Mach = Convert.ToSingle(Mach_str); @@ -1427,7 +1427,7 @@ private void GraphGUI(bool tmp) FlapToggle(); GUILayout.Label("Pitch Setting:"); pitch_str = GUILayout.TextField(pitch_str, GUILayout.ExpandWidth(true)); - pitch_str = Regex.Replace(pitch_str, @"[^-?\d*\.?\d*]", ""); + pitch_str = Regex.Replace(pitch_str, @"[^-?[0-9]*(\.[0-9]*)?]", ""); GUILayout.Label("Fuel Status:"); vehicleFueled = GUILayout.Toggle(vehicleFueled, vehicleFueled ? "Full" : "Empty"); GUILayout.Label("Spoilers:"); @@ -1452,35 +1452,35 @@ private void GraphGUI(bool tmp) bool MSweep = GUILayout.Button("Sweep Mach", ButtonStyle, GUILayout.Width(100.0F), GUILayout.Height(25.0F)); if (AoASweep) { - lowerBound_str = Regex.Replace(lowerBound_str, @"[^-?\d*\.?\d*]", ""); + lowerBound_str = Regex.Replace(lowerBound_str, @"[^-?[0-9]*(\.[0-9]*)?]", ""); lowerBound = Convert.ToDouble(lowerBound_str); lowerBound = FARMathUtil.Clamp(lowerBound, -90, 90); lowerBound_str = lowerBound.ToString(); - upperBound_str = Regex.Replace(upperBound_str, @"[^-?\d*\.?\d*]", ""); + upperBound_str = Regex.Replace(upperBound_str, @"[^-?[0-9]*(\.[0-9]*)?]", ""); upperBound = Convert.ToDouble(upperBound_str); upperBound = FARMathUtil.Clamp(upperBound, lowerBound, 90); upperBound_str = upperBound.ToString(); - numPoints_str = Regex.Replace(numPoints_str, @"[^-?\d*\.?\d*]", ""); + numPoints_str = Regex.Replace(numPoints_str, @"[^-?[0-9]*(\.[0-9]*)?]", ""); numPoints = Convert.ToUInt32(numPoints_str); double pitch = UpdateControlSettings(); - extra_str = Regex.Replace(extra_str, @"[^-?\d*\.?\d*]", ""); + extra_str = Regex.Replace(extra_str, @"[^-?[0-9]*(\.[0-9]*)?]", ""); double M = Math.Abs(Convert.ToDouble(extra_str)); AngleOfAttackSweep(M, pitch); } else if (MSweep) { - lowerBound_str = Regex.Replace(lowerBound_str, @"[^-?\d*\.?\d*]", ""); + lowerBound_str = Regex.Replace(lowerBound_str, @"[^-?[0-9]*(\.[0-9]*)?]", ""); lowerBound = Convert.ToDouble(lowerBound_str); lowerBound = FARMathUtil.Clamp(lowerBound, 0, double.PositiveInfinity); lowerBound_str = lowerBound.ToString(); - upperBound_str = Regex.Replace(upperBound_str, @"[^-?\d*\.?\d*]", ""); + upperBound_str = Regex.Replace(upperBound_str, @"[^-?[0-9]*(\.[0-9]*)?]", ""); upperBound = Convert.ToDouble(upperBound_str); upperBound = FARMathUtil.Clamp(upperBound, lowerBound, double.PositiveInfinity); upperBound_str = upperBound.ToString(); - numPoints_str = Regex.Replace(numPoints_str, @"[^-?\d*\.?\d*]", ""); + numPoints_str = Regex.Replace(numPoints_str, @"[^-?[0-9]*(\.[0-9]*)?]", ""); numPoints = Convert.ToUInt32(numPoints_str); double pitch = UpdateControlSettings(); - extra_str = Regex.Replace(extra_str, @"[^-?\d*\.?\d*]", ""); + extra_str = Regex.Replace(extra_str, @"[^-?[0-9]*(\.[0-9]*)?]", ""); double AoA = Math.Abs(Convert.ToDouble(extra_str)); MachNumberSweep(AoA, pitch); } diff --git a/FerramAerospaceResearch/FARGUIUtils.cs b/FerramAerospaceResearch/FARGUIUtils.cs index 4b9f49de4..6018d8978 100644 --- a/FerramAerospaceResearch/FARGUIUtils.cs +++ b/FerramAerospaceResearch/FARGUIUtils.cs @@ -1,5 +1,5 @@ /* -Ferram Aerospace Research v0.14.1.2 +Ferram Aerospace Research v0.14.2 Copyright 2014, Michael Ferrara, aka Ferram4 This file is part of Ferram Aerospace Research. @@ -44,8 +44,6 @@ namespace ferram4 { static class FARGUIUtils { - public static Color defaultHighlightColor; - public static Rect ClampToScreen(Rect window) { window.x = Mathf.Clamp(window.x, -window.width + 20, Screen.width - 20); diff --git a/FerramAerospaceResearch/FARGeoUtil.cs b/FerramAerospaceResearch/FARGeoUtil.cs index e66d3bad4..21f79ea01 100644 --- a/FerramAerospaceResearch/FARGeoUtil.cs +++ b/FerramAerospaceResearch/FARGeoUtil.cs @@ -1,5 +1,5 @@ /* -Ferram Aerospace Research v0.14.1.2 +Ferram Aerospace Research v0.14.2 Copyright 2014, Michael Ferrara, aka Ferram4 This file is part of Ferram Aerospace Research. @@ -339,7 +339,7 @@ public static Vector3 GuessUpVector(Part part) return Vector3.up; } - Debug.Log(part.partInfo.title + ": Choosing " + (dirname == null ? "heuristic forward" : dirname) + " axis for FAR drag model."); + //Debug.Log(part.partInfo.title + ": Choosing " + (dirname == null ? "heuristic forward" : dirname) + " axis for FAR drag model."); return dir; } else @@ -405,7 +405,7 @@ public static List PartModelTransformList(Part p) if (p.partTransform == null) { bool root = p == p.vessel.rootPart; - Debug.Log("This one is busted: " + p.partInfo.title + " root? " + root); + //Debug.Log("This one is busted: " + p.partInfo.title + " root? " + root); if (root) p.partTransform = p.vessel.vesselTransform; } @@ -431,7 +431,7 @@ public static List PartModelTransformList(Part p) //foreach (Transform t in returnList) // Debug.Log(t.name); - Debug.Log("Part: " + p.partInfo.title + " Transforms: " + returnList.Count); + //Debug.Log("Part: " + p.partInfo.title + " Transforms: " + returnList.Count); return returnList; } @@ -725,7 +725,7 @@ public static BodyGeometryForDrag CalcBodyGeometryFromMesh(Part p) //This is the cross-sectional area of the tapered section - Debug.Log(p.partInfo.title + ": Geometry model created; Size: " + size + ", LD " + lowerDiameters + ", UD " + upperDiameters + "\n\rSurface area: " + partGeometry.area + "\n\rFineness Ratio: " + partGeometry.finenessRatio + "\n\rTaperRatio: " + partGeometry.taperRatio + "\n\rCross Sectional Area: " + partGeometry.crossSectionalArea + "\n\rCross Sectional Tapered Area: " + partGeometry.taperCrossSectionArea + "\n\rMajor-minor axis ratio: " + partGeometry.majorMinorAxisRatio + "\n\rCentroid: " + partGeometry.originToCentroid); + //Debug.Log(p.partInfo.title + ": Geometry model created; Size: " + size + ", LD " + lowerDiameters + ", UD " + upperDiameters + "\n\rSurface area: " + partGeometry.area + "\n\rFineness Ratio: " + partGeometry.finenessRatio + "\n\rTaperRatio: " + partGeometry.taperRatio + "\n\rCross Sectional Area: " + partGeometry.crossSectionalArea + "\n\rCross Sectional Tapered Area: " + partGeometry.taperCrossSectionArea + "\n\rMajor-minor axis ratio: " + partGeometry.majorMinorAxisRatio + "\n\rCentroid: " + partGeometry.originToCentroid); return partGeometry; } diff --git a/FerramAerospaceResearch/FARGlobalControlEditorObject.cs b/FerramAerospaceResearch/FARGlobalControlEditorObject.cs index 22b199ac1..cd29117ab 100644 --- a/FerramAerospaceResearch/FARGlobalControlEditorObject.cs +++ b/FerramAerospaceResearch/FARGlobalControlEditorObject.cs @@ -1,5 +1,5 @@ /* -Ferram Aerospace Research v0.14.1.2 +Ferram Aerospace Research v0.14.2 Copyright 2014, Michael Ferrara, aka Ferram4 This file is part of Ferram Aerospace Research. @@ -62,6 +62,9 @@ public class FARGlobalControlEditorObject : UnityEngine.MonoBehaviour public void Awake() { + if (!CompatibilityChecker.IsAllCompatible()) + return; + LoadConfigs(); if (FARDebugValues.useBlizzyToolbar) @@ -133,6 +136,9 @@ private void ShowUI() public void LateUpdate() { + if (!CompatibilityChecker.IsAllCompatible()) + return; + FARAeroUtil.ResetEditorParts(); FARBaseAerodynamics.GlobalCoLReady = false; @@ -297,6 +303,9 @@ private bool FindPartsWithoutFARModel(List editorShip) void OnDestroy() { + if (!CompatibilityChecker.IsAllCompatible()) + return; + SaveConfigs(); GameEvents.onGUIApplicationLauncherReady.Remove(OnGUIAppLauncherReady); GameEvents.onShowUI.Remove(ShowUI); diff --git a/FerramAerospaceResearch/FARGlobalControlFlightObject.cs b/FerramAerospaceResearch/FARGlobalControlFlightObject.cs index e876b471d..05aa0b7f1 100644 --- a/FerramAerospaceResearch/FARGlobalControlFlightObject.cs +++ b/FerramAerospaceResearch/FARGlobalControlFlightObject.cs @@ -1,5 +1,5 @@ /* -Ferram Aerospace Research v0.14.1.2 +Ferram Aerospace Research v0.14.2 Copyright 2014, Michael Ferrara, aka Ferram4 This file is part of Ferram Aerospace Research. @@ -57,6 +57,9 @@ public class FARGlobalControlFlightObject : UnityEngine.MonoBehaviour public void Awake() { + if (!CompatibilityChecker.IsAllCompatible()) + return; + LoadConfigs(); if (FARDebugValues.useBlizzyToolbar) { @@ -101,6 +104,9 @@ void DummyVoid() { } public void Start() { + if (!CompatibilityChecker.IsAllCompatible()) + return; + GameEvents.onVesselLoaded.Add(FindPartsWithoutFARModel); GameEvents.onVesselGoOffRails.Add(FindPartsWithoutFARModel); GameEvents.onVesselWasModified.Add(UpdateFARPartModules); @@ -251,6 +257,8 @@ private void ChangeControlSys(Vessel v) public void LateUpdate() { + if (!CompatibilityChecker.IsAllCompatible()) + return; if (FlightGlobals.ready) { @@ -266,7 +274,10 @@ public void LateUpdate() void OnDestroy() { - if(config != null) + if (!CompatibilityChecker.IsAllCompatible()) + return; + + if (config != null) SaveConfigs(); GameEvents.onGUIApplicationLauncherReady.Remove(OnGUIAppLauncherReady); diff --git a/FerramAerospaceResearch/FARMathUtil.cs b/FerramAerospaceResearch/FARMathUtil.cs index 2f5fc2d24..fd9d9ea19 100644 --- a/FerramAerospaceResearch/FARMathUtil.cs +++ b/FerramAerospaceResearch/FARMathUtil.cs @@ -1,5 +1,5 @@ /* -Ferram Aerospace Research v0.14.1.2 +Ferram Aerospace Research v0.14.2 Copyright 2014, Michael Ferrara, aka Ferram4 This file is part of Ferram Aerospace Research. diff --git a/FerramAerospaceResearch/FARMatrix.cs b/FerramAerospaceResearch/FARMatrix.cs index 5474b1171..9d6d847c3 100644 --- a/FerramAerospaceResearch/FARMatrix.cs +++ b/FerramAerospaceResearch/FARMatrix.cs @@ -1,5 +1,5 @@ /* -Ferram Aerospace Research v0.14.1.2 +Ferram Aerospace Research v0.14.2 Copyright 2014, Michael Ferrara, aka Ferram4 This file is part of Ferram Aerospace Research. diff --git a/FerramAerospaceResearch/FARPM.cs b/FerramAerospaceResearch/FARPM.cs index dcf282c49..3b205ac16 100644 --- a/FerramAerospaceResearch/FARPM.cs +++ b/FerramAerospaceResearch/FARPM.cs @@ -1,5 +1,5 @@ /* -Ferram Aerospace Research v0.14.1.2 +Ferram Aerospace Research v0.14.2 Copyright 2014, Michael Ferrara, aka Ferram4 This file is part of Ferram Aerospace Research. diff --git a/FerramAerospaceResearch/FARPartClassification.cs b/FerramAerospaceResearch/FARPartClassification.cs index 837b0e700..960a2a9f7 100644 --- a/FerramAerospaceResearch/FARPartClassification.cs +++ b/FerramAerospaceResearch/FARPartClassification.cs @@ -1,5 +1,5 @@ /* -Ferram Aerospace Research v0.14.1.2 +Ferram Aerospace Research v0.14.2 Copyright 2014, Michael Ferrara, aka Ferram4 This file is part of Ferram Aerospace Research. diff --git a/FerramAerospaceResearch/FARPartModule.cs b/FerramAerospaceResearch/FARPartModule.cs index dfa9fc3c8..faff40b06 100644 --- a/FerramAerospaceResearch/FARPartModule.cs +++ b/FerramAerospaceResearch/FARPartModule.cs @@ -1,5 +1,5 @@ /* -Ferram Aerospace Research v0.14.1.2 +Ferram Aerospace Research v0.14.2 Copyright 2014, Michael Ferrara, aka Ferram4 This file is part of Ferram Aerospace Research. @@ -55,6 +55,12 @@ public void ForceOnVesselPartsChange() public virtual void Start() { + if (!CompatibilityChecker.IsAllCompatible()) + { + this.enabled = false; + return; + } + OnVesselPartsChange = UpdateShipPartsList; UpdateShipPartsList(); diff --git a/FerramAerospaceResearch/FARPayloadFairingModule.cs b/FerramAerospaceResearch/FARPayloadFairingModule.cs index 54aee5a05..d22d298e4 100644 --- a/FerramAerospaceResearch/FARPayloadFairingModule.cs +++ b/FerramAerospaceResearch/FARPayloadFairingModule.cs @@ -1,5 +1,5 @@ /* -Ferram Aerospace Research v0.14.1.2 +Ferram Aerospace Research v0.14.2 Copyright 2014, Michael Ferrara, aka Ferram4 This file is part of Ferram Aerospace Research. @@ -175,6 +175,18 @@ private void FindShieldedParts() ClearShieldedParts(); UpdateShipPartsList(); + Collider[] colliders; + try + { + colliders = part.GetComponentsInChildren(); + } + catch (Exception e) + { + //Fail silently because it's the only way to avoid issues with pWings + //Debug.LogException(e); + colliders = new Collider[1] { part.collider }; + } + for (int i = 0; i < VesselPartList.Count; i++) { Part p = VesselPartList[i]; @@ -206,7 +218,6 @@ private void FindShieldedParts() relPos += p.partTransform.TransformDirection(d.CenterOfDrag) + p.partTransform.position; //No attach node shifting with this } - relPos = this.part.transform.worldToLocalMatrix.MultiplyVector(relPos); for (int j = 0; j < minBounds.Count; j++) { @@ -215,6 +226,23 @@ private void FindShieldedParts() maxBoundVec = maxBounds[j]; if (relPos.x < maxBoundVec.x && relPos.y < maxBoundVec.y && relPos.z < maxBoundVec.z && relPos.x > minBoundVec.x && relPos.y > minBoundVec.y && relPos.z > minBoundVec.z) { + Vector3 vecFromPToCargoBayCenter = this.part.partTransform.position - p.partTransform.position; + + RaycastHit[] hits = Physics.RaycastAll(p.partTransform.position, vecFromPToCargoBayCenter, vecFromPToCargoBayCenter.magnitude, FARAeroUtil.RaycastMask); + + bool outsideMesh = false; + + for (int k = 0; k < hits.Length; k++) + { + if (colliders.Contains(hits[k].collider)) + { + outsideMesh = true; + break; + } + } + if (outsideMesh) + break; + FARShieldedParts.Add(p); if (b) { diff --git a/FerramAerospaceResearch/FARRungeKutta.cs b/FerramAerospaceResearch/FARRungeKutta.cs index 5c5c48faa..f05122ec4 100644 --- a/FerramAerospaceResearch/FARRungeKutta.cs +++ b/FerramAerospaceResearch/FARRungeKutta.cs @@ -1,5 +1,5 @@ /* -Ferram Aerospace Research v0.14.1.2 +Ferram Aerospace Research v0.14.2 Copyright 2014, Michael Ferrara, aka Ferram4 This file is part of Ferram Aerospace Research. diff --git a/FerramAerospaceResearch/FARWingAerodynamicModel.cs b/FerramAerospaceResearch/FARWingAerodynamicModel.cs index 4088424c4..ee2b71c1d 100644 --- a/FerramAerospaceResearch/FARWingAerodynamicModel.cs +++ b/FerramAerospaceResearch/FARWingAerodynamicModel.cs @@ -1,5 +1,5 @@ /* -Ferram Aerospace Research v0.14.1.2 +Ferram Aerospace Research v0.14.2 Copyright 2014, Michael Ferrara, aka Ferram4 This file is part of Ferram Aerospace Research. @@ -328,13 +328,10 @@ public override void Start() public void MathAndFunctionInitialization() { - double lengthScale = Math.Sqrt(FARAeroUtil.areaFactor); - - b_2 *= lengthScale; - MAC *= lengthScale; - S = b_2 * MAC; + S *= FARAeroUtil.areaFactor; + if (part.srfAttachNode.originalOrientation.x < 0) srfAttachNegative = -1; @@ -550,6 +547,7 @@ private void GetRefAreaChildren() if ((object)parentWing != null) { parentWing.GetRefAreaChildren(); + parentWing.UpdateMassToAccountForArea(); } } diff --git a/FerramAerospaceResearch/Properties/AssemblyInfo.cs b/FerramAerospaceResearch/Properties/AssemblyInfo.cs index f569f344a..5fcfab137 100644 --- a/FerramAerospaceResearch/Properties/AssemblyInfo.cs +++ b/FerramAerospaceResearch/Properties/AssemblyInfo.cs @@ -34,5 +34,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.14.1.2")] -[assembly: AssemblyFileVersion("0.14.1.2")] +[assembly: AssemblyVersion("0.14.2.0")] +[assembly: AssemblyFileVersion("0.14.2.0")] diff --git a/GameData/FerramAerospaceResearch/FAR.version b/GameData/FerramAerospaceResearch/FAR.version index ad2a65fb8..a2aae1d4f 100644 --- a/GameData/FerramAerospaceResearch/FAR.version +++ b/GameData/FerramAerospaceResearch/FAR.version @@ -4,11 +4,11 @@ "VERSION": { "MAJOR": 0, "MINOR": 14, - "PATCH": 1 + "PATCH": 2 }, "KSP_VERSION": { "MAJOR": 0, - "MINOR": 24, - "PATCH": 2 + "MINOR": 25, + "PATCH": 0 } } diff --git a/GameData/FerramAerospaceResearch/FARAeroStress.cfg b/GameData/FerramAerospaceResearch/FARAeroStress.cfg index 73d265894..5282e24c1 100644 --- a/GameData/FerramAerospaceResearch/FARAeroStress.cfg +++ b/GameData/FerramAerospaceResearch/FARAeroStress.cfg @@ -21,7 +21,7 @@ FARAeroStress name = rocketFuelTank //Stress values are based on projected area, measured in kPa; Y is based on cross-sectional, while XZ is based on the projected side area YmaxStress = 500 - XZmaxStress = 12 + XZmaxStress = 15 Resources { numReq = 1 @@ -61,7 +61,7 @@ FARAeroStress name = wingStress isSpecialTemplate = True //Stress values are based on projected area, measured in kPa; Y is based on cross-sectional, while XZ is based on the projected side area - YmaxStress = 60 + YmaxStress = 70 XZmaxStress = 40 } FARPartStressTemplate @@ -69,7 +69,7 @@ FARAeroStress name = ctrlSurfStress isSpecialTemplate = True //Stress values are based on projected area, measured in kPa; Y is based on cross-sectional, while XZ is based on the projected side area - YmaxStress = 120 + YmaxStress = 140 XZmaxStress = 60 } } \ No newline at end of file diff --git a/GameData/FerramAerospaceResearch/FerramAerospaceResearch.cfg b/GameData/FerramAerospaceResearch/FerramAerospaceResearch.cfg index 25c218c52..e0a87412b 100644 --- a/GameData/FerramAerospaceResearch/FerramAerospaceResearch.cfg +++ b/GameData/FerramAerospaceResearch/FerramAerospaceResearch.cfg @@ -179,93 +179,6 @@ TaperRatio = 0.176 } } -@PART[deltaWing]:FOR[FerramAerospaceResearch] -{ - @module = Part - @maximum_drag = 0 - @minimum_drag = 0 - @angularDrag = 0 - @dragCoeff = 0 - @deflectionLiftCoeff = 0 - MODULE - { - name = FARWingAerodynamicModel - MAC = 2.264 - MidChordSweep = 22.16 - b_2 = 3.601 - TaperRatio = 0.188 - rootMidChordOffsetFromOrig = 0, 0.5, 0 - } -} -@PART[smallCtrlSrf]:FOR[FerramAerospaceResearch] -{ - @module = Part - @maximum_drag = 0 - @minimum_drag = 0 - @angularDrag = 0 - @dragCoeff = 0 - @deflectionLiftCoeff = 0 - MODULE - { - name = FARControllableSurface - MAC = 0.541 - maxdeflect = 20 - nonSideAttach = 1 - b_2 = 0.889 - TaperRatio = 1 - } -} -@PART[sweptWing]:FOR[FerramAerospaceResearch] -{ - @module = Part - @maximum_drag = 0 - @minimum_drag = 0 - @angularDrag = 0 - @dragCoeff = 0 - @deflectionLiftCoeff = 0 - MODULE - { - name = FARWingAerodynamicModel - MAC = 1.448 - MidChordSweep = 11.53 - b_2 = 4.813 - TaperRatio = 0.747 - } -} -@PART[tailfin]:FOR[FerramAerospaceResearch] -{ - @module = Part - @maximum_drag = 0 - @minimum_drag = 0 - @angularDrag = 0 - @dragCoeff = 0 - @deflectionLiftCoeff = 0 - MODULE - { - name = FARWingAerodynamicModel - MAC = 1.497 - MidChordSweep = 24.9 - b_2 = 1.49 - TaperRatio = 0.291 - } -} -@PART[wingConnector]:FOR[FerramAerospaceResearch] -{ - @module = Part - @maximum_drag = 0 - @minimum_drag = 0 - @angularDrag = 0 - @dragCoeff = 0 - @deflectionLiftCoeff = 0 - MODULE - { - name = FARWingAerodynamicModel - MAC = 3.516 - MidChordSweep = 0 - b_2 = 1.744 - TaperRatio = 1 - } -} @PART[winglet]:FOR[FerramAerospaceResearch] { @module = Part @@ -324,23 +237,481 @@ ctrlSurfFrac = 0.2 } } -@PART[structuralWing]:FOR[FerramAerospaceResearch] +@PART[sweptWing]:FOR[FerramAerospaceResearch] { - @module = Part - @maximum_drag = 0 - @minimum_drag = 0 - @angularDrag = 0 - @dragCoeff = 0 - @deflectionLiftCoeff = 0 - MODULE - { - name = FARWingAerodynamicModel - MAC = 1.849 - MidChordSweep = 43.84 - b_2 = 1.876 - TaperRatio = 0 - } +@module = Part +@maximum_drag = 0 +@minimum_drag = 0 +@angularDrag = 0 +@dragCoeff = 0 +@deflectionLiftCoeff = 0 +MODULE +{ +name = FARWingAerodynamicModel +MAC = 1.448 +MidChordSweep = 11.53 +b_2 = 4.813 +TaperRatio = 0.747 +} +} +@PART[tailfin]:FOR[FerramAerospaceResearch] +{ +@module = Part +@maximum_drag = 0 +@minimum_drag = 0 +@angularDrag = 0 +@dragCoeff = 0 +@deflectionLiftCoeff = 0 +MODULE +{ +name = FARWingAerodynamicModel +MAC = 1.497 +MidChordSweep = 24.9 +b_2 = 1.49 +TaperRatio = 0.291 +} +} +// SpaceplanePlus 0.25 parts FAR values. + +// Adapters +@PART[mk2_1m_Bicoupler]:NEEDS[FerramAerospaceResearch|NEAR]:Final { + @minimum_drag = 0 + @maximum_drag = 0 + @angularDrag = 0 + !MODULE[ModuleLiftingSurface] {} +} + +@PART[mk2_1m_AdapterLong]:NEEDS[FerramAerospaceResearch|NEAR]:Final { + @minimum_drag = 0 + @maximum_drag = 0 + @angularDrag = 0 + !MODULE[ModuleLiftingSurface] {} +} + +@PART[mk2SpacePlaneAdapter]:NEEDS[FerramAerospaceResearch|NEAR]:Final { + @minimum_drag = 0 + @maximum_drag = 0 + @angularDrag = 0 + !MODULE[ModuleLiftingSurface] {} +} + +// Cargo bays +@PART[mk2CargoBayL]:NEEDS[FerramAerospaceResearch|NEAR]:Final { + @minimum_drag = 0 + @maximum_drag = 0 + @angularDrag = 0 + !MODULE[ModuleLiftingSurface] {} +} + +@PART[mk2CargoBayS]:NEEDS[FerramAerospaceResearch|NEAR]:Final { + @minimum_drag = 0 + @maximum_drag = 0 + @angularDrag = 0 + !MODULE[ModuleLiftingSurface] {} +} + +// Cockpits +@PART[mk2Cockpit_Inline]:NEEDS[FerramAerospaceResearch|NEAR]:Final { + @minimum_drag = 0 + @maximum_drag = 0 + @angularDrag = 0 + !MODULE[ModuleLiftingSurface] {} +} +@PART[mk2Cockpit_Standard]:NEEDS[FerramAerospaceResearch|NEAR]:Final { + @minimum_drag = 0 + @maximum_drag = 0 + @angularDrag = 0 + !MODULE[ModuleLiftingSurface] {} +} +@PART[mk2CrewCabin]:NEEDS[FerramAerospaceResearch|NEAR]:Final { + @module = Part + @minimum_drag = 0 + @maximum_drag = 0 + @angularDrag = 0 + !MODULE[ModuleLiftingSurface] {} +} + +// Docking Port +@PART[mk2DockingPort]:NEEDS[FerramAerospaceResearch|NEAR]:Final { + @minimum_drag = 0 + @maximum_drag = 0 + @angularDrag = 0 + !MODULE[ModuleLiftingSurface] {} +} + +// Fuselage Long +@PART[mk2Fuselage]:NEEDS[FerramAerospaceResearch|NEAR]:Final { + @minimum_drag = 0 + @maximum_drag = 0 + @angularDrag = 0 + !MODULE[ModuleLiftingSurface] {} +} + +@PART[mk2FuselageLongLFO]:NEEDS[FerramAerospaceResearch|NEAR]:Final { + @minimum_drag = 0 + @maximum_drag = 0 + @angularDrag = 0 + !MODULE[ModuleLiftingSurface] {} +} + +// Fuselage Short +@PART[mk2FuselageShortLiquid]:NEEDS[FerramAerospaceResearch|NEAR]:Final { + @minimum_drag = 0 + @maximum_drag = 0 + @angularDrag = 0 + !MODULE[ModuleLiftingSurface] {} +} +@PART[mk2FuselageShortLFO]:NEEDS[FerramAerospaceResearch|NEAR]:Final { + @minimum_drag = 0 + @maximum_drag = 0 + @angularDrag = 0 + !MODULE[ModuleLiftingSurface] {} +} +@PART[mk2FuselageShortMono]:NEEDS[FerramAerospaceResearch|NEAR]:Final { + @minimum_drag = 0 + @maximum_drag = 0 + @angularDrag = 0 + !MODULE[ModuleLiftingSurface] {} +} + +// Wings + +// Connector 1 +@PART[wingConnector]:NEEDS[FerramAerospaceResearch|NEAR]:Final { + @module = Part + @maximum_drag = 0 + @minimum_drag = 0 + @angularDrag = 0 + !dragCoeff = DELETE + !deflectionLiftCoeff = DELETE + !MODULE[ModuleLiftingSurface] {} + %MODULE[FARWingAerodynamicModel] { + %b_2 = 1.875 + %MAC = 4.125 + %TaperRatio = 1 + %MidChordSweep = 0 + } +} + +// Connector 2 +@PART[wingConnector2]:NEEDS[FerramAerospaceResearch|NEAR]:Final { + @module = Part + @maximum_drag = 0 + @minimum_drag = 0 + @angularDrag = 0 + !dragCoeff = DELETE + !deflectionLiftCoeff = DELETE + !MODULE[ModuleLiftingSurface] {} + %MODULE[FARWingAerodynamicModel] { + %b_2 = 3.75 + + %MAC = 2.25 + %TaperRatio = 1 + %MidChordSweep = 0 + } +} + +// Connector 3 +@PART[wingConnector3]:NEEDS[FerramAerospaceResearch|NEAR]:Final { + @module = Part + @maximum_drag = 0 + @minimum_drag = 0 + @angularDrag = 0 + !dragCoeff = DELETE + !deflectionLiftCoeff = DELETE + !MODULE[ModuleLiftingSurface] {} + %MODULE[FARWingAerodynamicModel] { + %b_2 = 1.875 + %MAC = 2.25 + %TaperRatio = 1 + %MidChordSweep = 0 + } +} + +// Connector 4 +@PART[wingConnector4]:NEEDS[FerramAerospaceResearch|NEAR]:Final { + @module = Part + @maximum_drag = 0 + @minimum_drag = 0 + @angularDrag = 0 + !dragCoeff = DELETE + !deflectionLiftCoeff = DELETE + !MODULE[ModuleLiftingSurface] {} + %MODULE[FARWingAerodynamicModel] { + %b_2 = 0.9375 + %MAC = 2.25 + %TaperRatio = 1 + %MidChordSweep = 0 + } +} + +// Connector 5 +@PART[wingConnector5]:NEEDS[FerramAerospaceResearch|NEAR]:Final { + @module = Part + @maximum_drag = 0 + @minimum_drag = 0 + @angularDrag = 0 + !dragCoeff = DELETE + !deflectionLiftCoeff = DELETE + !MODULE[ModuleLiftingSurface] {} + %MODULE[FARWingAerodynamicModel] { + %b_2 = 1.875 + %MAC = 1.313 + %TaperRatio = 1 + %MidChordSweep = 0 + } +} + +// Delta +@PART[deltaWing]:NEEDS[FerramAerospaceResearch|NEAR]:Final { + @module = Part + @maximum_drag = 0 + @minimum_drag = 0 + @angularDrag = 0 + !dragCoeff = DELETE + !deflectionLiftCoeff = DELETE + !MODULE[ModuleLiftingSurface] {} + %MODULE[FARWingAerodynamicModel] { + %b_2 = 3.75 + %MAC = 2.25 + %TaperRatio = 0.091 + %MidChordSweep = 26.57 + } +} + +// Delta Small +@PART[delta_small]:NEEDS[FerramAerospaceResearch|NEAR]:Final { + @module = Part + @maximum_drag = 0 + @minimum_drag = 0 + @angularDrag = 0 + !dragCoeff = DELETE + !deflectionLiftCoeff = DELETE + !MODULE[ModuleLiftingSurface] {} + %MODULE[FARWingAerodynamicModel] { + %b_2 = 1.875 + %MAC = 1.313 + %TaperRatio = 0.167 + %MidChordSweep = 26.57 + } +} + +// Strake +@PART[wingStrake]:NEEDS[FerramAerospaceResearch|NEAR]:Final { + @module = Part + @maximum_drag = 0 + @minimum_drag = 0 + @angularDrag = 0 + !dragCoeff = DELETE + !deflectionLiftCoeff = DELETE + !MODULE[ModuleLiftingSurface] {} + %MODULE[FARWingAerodynamicModel] { + %b_2 = 0.938 + %MAC = 2.25 + %TaperRatio = 0.091 + %MidChordSweep = 63.42 + } +} + +// Structural 1 +@PART[structuralWing]:NEEDS[FerramAerospaceResearch|NEAR]:Final { + @module = Part + @maximum_drag = 0 + @minimum_drag = 0 + @angularDrag = 0 + !dragCoeff = DELETE + !deflectionLiftCoeff = DELETE + !MODULE[ModuleLiftingSurface] {} + %MODULE[FARWingAerodynamicModel] { + %b_2 = 1.875 + %MAC = 2.25 + %TaperRatio = 0.091 + %MidChordSweep = 44.99 + } +} + +// Structural 2 +@PART[structuralWing2]:NEEDS[FerramAerospaceResearch|NEAR]:Final { + @module = Part + @maximum_drag = 0 + @minimum_drag = 0 + @angularDrag = 0 + !dragCoeff = DELETE + !deflectionLiftCoeff = DELETE + !MODULE[ModuleLiftingSurface] {} + %MODULE[FARWingAerodynamicModel] { + %b_2 = 3.75 + %MAC = 1.313 + %TaperRatio = 0.167 + %MidChordSweep = 14.04 + } +} + +// Structural 3 +@PART[structuralWing3]:NEEDS[FerramAerospaceResearch|NEAR]:Final { + @module = Part + @maximum_drag = 0 + @minimum_drag = 0 + @angularDrag = 0 + !dragCoeff = DELETE + !deflectionLiftCoeff = DELETE + !MODULE[ModuleLiftingSurface] {} + %MODULE[FARWingAerodynamicModel] { + %b_2 = 3.75 + %MAC = 0.844 + %TaperRatio = 0.286 + %MidChordSweep = 7.13 + } +} + +// Structural 4 +@PART[structuralWing4]:NEEDS[FerramAerospaceResearch|NEAR]:Final { + @module = Part + @maximum_drag = 0 + @minimum_drag = 0 + @angularDrag = 0 + !dragCoeff = DELETE + !deflectionLiftCoeff = DELETE + !MODULE[ModuleLiftingSurface] {} + %MODULE[FARWingAerodynamicModel] { + %b_2 = 0.938 + %MAC = 1.313 + %TaperRatio = 0.167 + %MidChordSweep = 44.99 + } } + +// Swept 1 +@PART[sweptWing1]:NEEDS[FerramAerospaceResearch|NEAR]:Final { + @module = Part + @maximum_drag = 0 + @minimum_drag = 0 + @angularDrag = 0 + !dragCoeff = DELETE + !deflectionLiftCoeff = DELETE + !MODULE[ModuleLiftingSurface] {} + %MODULE[FARWingAerodynamicModel] { + %b_2 = 3.75 + %MAC = 1.313 + %TaperRatio = 0.167 + %MidChordSweep = 36.87 + %rootMidChordOffsetFromOrig = 0, 1.313, 0 } +} + +// Swept 2 +@PART[sweptWing2]:NEEDS[FerramAerospaceResearch|NEAR]:Final { + @module = Part + @maximum_drag = 0 + @minimum_drag = 0 + @angularDrag = 0 + !dragCoeff = DELETE + !deflectionLiftCoeff = DELETE + !MODULE[ModuleLiftingSurface] {} + %MODULE[FARWingAerodynamicModel] { + %b_2 = 3.75 + %MAC = 2.25 + %TaperRatio = 1 + %MidChordSweep = 26.57 + %rootMidChordOffsetFromOrig = 0, 1.313, 0 } +} + +// Elevon 1 +@PART[StandardCtrlSrf]:NEEDS[FerramAerospaceResearch|NEAR]:Final { + @maximum_drag = 0 + @minimum_drag = 0 + @angularDrag = 0 + !MODULE[ModuleControlSurface] {} + %MODULE[FARControllableSurface] { + %b_2 = 1.825 + %MAC = 0.519 + %TaperRatio = 1 + %MidChordSweep = 0 + %nonSideAttach = 1 + %maxdeflect = 20 + %ctrlSurfFrac = 1 + %transformName = Elevon1 + %rootMidChordOffsetFromOrig = 0, 0.09375, 0 + } +} + +// Elevon 2 +@PART[elevon2]:NEEDS[FerramAerospaceResearch|NEAR]:Final { + @maximum_drag = 0 + @minimum_drag = 0 + @angularDrag = 0 + !MODULE[ModuleControlSurface] {} + %MODULE[FARControllableSurface] { + %b_2 = 1.825 + %MAC = 0.633 + %TaperRatio = 0.695 + %MidChordSweep = -3.58 + %nonSideAttach = 1 + %maxdeflect = 20 + %ctrlSurfFrac = 1 + %transformName = Elevon2 + %rootMidChordOffsetFromOrig = 0, 0.09375, 0 + } +} + +// Elevon 3 +@PART[elevon3]:NEEDS[FerramAerospaceResearch|NEAR]:Final { + @maximum_drag = 0 + @minimum_drag = 0 + @angularDrag = 0 + !MODULE[ModuleControlSurface] {} + %MODULE[FARControllableSurface] { + %b_2 = 1.825 + %MAC = 0.864 + %TaperRatio = 0.761 + %MidChordSweep = -3.67 + %nonSideAttach = 1 + %maxdeflect = 20 + %ctrlSurfFrac = 1 + %transformName = Elevon3 + %rootMidChordOffsetFromOrig = 0, 0.09375, 0 + } +} + +// Elevon 4 +@PART[smallCtrlSrf]:NEEDS[FerramAerospaceResearch|NEAR]:Final { + @maximum_drag = 0 + @minimum_drag = 0 + @angularDrag = 0 + !MODULE[ModuleControlSurface] {} + %MODULE[FARControllableSurface] { + %b_2 = 0.888 + %MAC = 0.747 + %TaperRatio = 1 + %MidChordSweep = 0 + %nonSideAttach = 1 + %maxdeflect = 20 + %ctrlSurfFrac = 1 + %transformName = Elevon4 + %rootMidChordOffsetFromOrig = 0, 0.09375, 0 + } +} + +// Elevon 5 +@PART[elevon5]:NEEDS[FerramAerospaceResearch|NEAR]:Final { + @maximum_drag = 0 + @minimum_drag = 0 + @angularDrag = 0 + !MODULE[ModuleControlSurface] {} + %MODULE[FARControllableSurface] { + %b_2 = 2 + %MAC = 0.747 + %TaperRatio = 1 + %MidChordSweep = 0 + %nonSideAttach = 1 + %maxdeflect = 20 + %ctrlSurfFrac = 1 + %transformName = Elevon5 + %rootMidChordOffsetFromOrig = 0, 0.09375, 0 + } +} + + + @PART[*]:HAS[@MODULE[ModuleEngines*]:HAS[@PROPELLANT[IntakeAir]]]:BEFORE[FerramAerospaceResearch]:NEEDS[!AJE] { @MODULE[ModuleEngines*] @@ -418,7 +789,7 @@ @dragCoeff = 0 @deflectionLiftCoeff = 0 } -@PART[*]:HAS[@MODULE[ModuleResourceIntake]]:FOR[FerramAerospaceResearch]:NEEDS[!AJE] +@PART[*]:HAS[@MODULE[ModuleResourceIntake]]:FOR[FerramAerospaceResearch] { @MODULE[ModuleResourceIntake] { @@ -433,7 +804,8 @@ MODULE { name = FARBasicDragModel - S = 1.58859927382939 + S = #$../MODULE[ModuleResourceIntake]/area$ //1.58859927382939 per 0.01 intake area + @S *= 158.859927382939 cosAngleCutoff = -0.877545339888915 majorMinorAxisRatio = 0.999999692164099 taperCrossSectionAreaRatio = 0.546403296718528 @@ -477,7 +849,7 @@ MODULE } @PART[mk1pod]:FOR[FerramAerospaceResearch] { - CoMOffset = 0, -0.2, 0 + CoMOffset = 0, -0.25, 0 } //These parts don't have their attach nodes at the correct size, so drag isn't calculated correctly on them @PART[asasmodule1-2]:FOR[FerramAerospaceResearch] @@ -510,16 +882,4 @@ MODULE key = 1 0 } } -} - -@PART[*]:HAS[@MODULE[ModuleLandingGear]]:FOR[FerramAerospaceResearch] -{ - @maximum_drag = 0 - @MODULE[ModuleLandingGear] - { - %deployedDragMax = 0 - %deployedDragMin = 0 - %stowedDragMax = 0 - %stowedDragMin = 0 - } -} +} \ No newline at end of file diff --git a/GameData/FerramAerospaceResearch/Plugins/FerramAerospaceResearch.dll b/GameData/FerramAerospaceResearch/Plugins/FerramAerospaceResearch.dll index 7fff38a0a..c360ba704 100644 Binary files a/GameData/FerramAerospaceResearch/Plugins/FerramAerospaceResearch.dll and b/GameData/FerramAerospaceResearch/Plugins/FerramAerospaceResearch.dll differ diff --git a/GameData/FerramAerospaceResearch/Plugins/ferramGraph.dll b/GameData/FerramAerospaceResearch/Plugins/ferramGraph.dll index c298480dc..e0f19fbea 100644 Binary files a/GameData/FerramAerospaceResearch/Plugins/ferramGraph.dll and b/GameData/FerramAerospaceResearch/Plugins/ferramGraph.dll differ diff --git a/README.md b/README.md index 620ebca4b..1b961e8aa 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -Ferram Aerospace Research v0.14.1.2 +Ferram Aerospace Research v0.14.2 ========================= Aerodynamics model for Kerbal Space Program @@ -150,13 +150,19 @@ For both of these, set MaxDrag and MinDrag to 0 CHANGELOG ======================================================= -0.14.1.2v------------------------------------ +0.14.2v------------------------------------ Features: -Prototype aero force visualization in flight +0.25 compatibility, with stock support for SP+ parts +Upgrade CompatibilityChecker +Disable functions on CompatibilityChecker warnings + +Prototype aero force visualization in flight +Removed vector from CoL indicator to reduce confusion More Get functions for the FARAPI Estimated range and endurance readouts in the Flight Data UI See and dump FAR module data in the VAB / SPH using the Editor GUI Some runtime optimizations + Contributed by Da Michel: Implement separate deflection speeds for flaps / spoilers Allow preferred default action groups for spoilers / flaps @@ -170,6 +176,7 @@ Bugfixes: Fixed some vessel-switching FAR GUI issues Fixed control surface reversal on undocking or backwards root part selection Fixed some issues involving CoL position with wings when dealing with parts that have multiple colliders +Fixed some payload fairing and cargo bay part detection issues 0.14.1.1v------------------------------------ Features: diff --git a/ferramGraph/ferramGraph.csproj b/ferramGraph/ferramGraph.csproj index db08d739c..ec439ab7f 100644 --- a/ferramGraph/ferramGraph.csproj +++ b/ferramGraph/ferramGraph.csproj @@ -47,10 +47,9 @@ + - - - + xcopy /y "$(TargetPath)" "$(SolutionDir)/GameData\FerramAerospaceResearch\Plugins"