Skip to content

Commit

Permalink
Savegame: working simulation with residuals
Browse files Browse the repository at this point in the history
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
  • Loading branch information
lamont-granquist committed Jul 1, 2023
1 parent f5979f7 commit 55727c5
Show file tree
Hide file tree
Showing 22 changed files with 1,960 additions and 13 deletions.
3 changes: 3 additions & 0 deletions MechJeb2.sln.DotSettings
Expand Up @@ -3,14 +3,17 @@
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=AN/@EntryIndexedValue">AN</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=AOA/@EntryIndexedValue">AOA</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=ASS/@EntryIndexedValue">ASS</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=ATM/@EntryIndexedValue">ATM</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=BCI/@EntryIndexedValue">BCI</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=BS/@EntryIndexedValue">BS</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=DP/@EntryIndexedValue">DP</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=ECC/@EntryIndexedValue">ECC</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=ECI/@EntryIndexedValue">ECI</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=ENU/@EntryIndexedValue">ENU</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=FFS/@EntryIndexedValue">FFS</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=FPA/@EntryIndexedValue">FPA</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=IPVG/@EntryIndexedValue">IPVG</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=ISP/@EntryIndexedValue">ISP</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=IVP/@EntryIndexedValue">IVP</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=KSC/@EntryIndexedValue">KSC</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=KSP/@EntryIndexedValue">KSP</s:String>
Expand Down
10 changes: 10 additions & 0 deletions MechJeb2/MathExtensions.cs
Expand Up @@ -177,6 +177,16 @@ public static Vector3d V3ToWorldRotated(this V3 vector)
return Planetarium.fetch.rotation * vector.ToVector3d().xzy;
}

public static void LoadH1(this H1 h, FloatCurve f)
{
h.Clear();

if (f == null) return;

foreach (Keyframe frame in f.Curve.keys)
h.Add(frame.time, frame.value, frame.inTangent, frame.outTangent);
}

public static Q3 ToQ3(this QuaternionD q)
{
return new Q3(q.z, q.y, q.x, -q.w);
Expand Down
26 changes: 13 additions & 13 deletions MechJeb2/MechJeb2.csproj
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')"/>
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
Expand All @@ -12,7 +12,7 @@
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<NoStdLib>true</NoStdLib>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<TargetFrameworkProfile/>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<LangVersion>8</LangVersion>
Expand Down Expand Up @@ -250,16 +250,16 @@
<Compile Include="alglib\statistics.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Properties\Resources.resx" />
<EmbeddedResource Include="Properties\Resources.resx"/>
</ItemGroup>
<ItemGroup>
<None Include="copy_build.bat" />
<None Include="copy_build.sh" />
<None Include="Properties\shader" />
<None Include="Properties\shader2" />
<None Include="Properties\shader3" />
<None Include="UnityToolbag\Dispatcher\README.md" />
<None Include="UnityToolbag\Future\README.md" />
<None Include="copy_build.bat"/>
<None Include="copy_build.sh"/>
<None Include="Properties\shader"/>
<None Include="Properties\shader2"/>
<None Include="Properties\shader3"/>
<None Include="UnityToolbag\Dispatcher\README.md"/>
<None Include="UnityToolbag\Future\README.md"/>
</ItemGroup>
<ItemGroup>
<Reference Include="Assembly-CSharp, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
Expand Down Expand Up @@ -321,12 +321,12 @@
<Private>False</Private>
</Reference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets"/>
<Target Name="AfterBuild" Condition=" '$(OS)' == 'Windows_NT' ">
<Exec Command="call &quot;$(ProjectDir)copy_build.bat&quot; &quot;$(TargetPath)&quot; &quot;$(TargetDir)&quot; &quot;$(TargetName)&quot; &quot;$(ProjectDir)&quot;" />
<Exec Command="call &quot;$(ProjectDir)copy_build.bat&quot; &quot;$(TargetPath)&quot; &quot;$(TargetDir)&quot; &quot;$(TargetName)&quot; &quot;$(ProjectDir)&quot;"/>
</Target>
<Target Name="AfterBuild" Condition=" '$(OS)' != 'Windows_NT' ">
<Exec Command="'$(ProjectDir)/copy_build.sh' '$(TargetPath)' '$(TargetDir)' '$(TargetName)' '$(ProjectDir)' '$(ReferencePath)'" />
<Exec Command="'$(ProjectDir)/copy_build.sh' '$(TargetPath)' '$(TargetDir)' '$(TargetName)' '$(ProjectDir)' '$(ReferencePath)'"/>
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
3 changes: 3 additions & 0 deletions MechJeb2/MechJebCore.cs
Expand Up @@ -6,6 +6,7 @@
using System.Reflection;
using JetBrains.Annotations;
using KSP.Localization;
using MechJebLib.Simulations;
using UnityEngine;
using UnityEngine.Profiling;
using UnityToolbag;
Expand Down Expand Up @@ -551,6 +552,8 @@ public override void OnInactive()
public override void OnAwake()
{
FuelFlowSimulation.FuelNode.DoReflection();
Builder.Bootstrap();

CachedLocalizer.Bootstrap();

Dispatcher.CreateDispatcher();
Expand Down

0 comments on commit 55727c5

Please sign in to comment.