Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from Sigma88/Development
Sigma Dimensions v0.7.0
- Loading branch information
Showing
16 changed files
with
324 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -97,12 +97,4 @@ | |
} | ||
} | ||
} | ||
@Body[Kerbin] | ||
{ | ||
%SpaceCenter | ||
{ | ||
&heightMapDeformity = 70 | ||
&absoluteOffset = 0 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 0 additions & 8 deletions
8
GameData/Sigma/Dimensions/Configs/ReDimension/resizeKonstructs.cfg
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,4 +23,5 @@ SigmaDimensions | |
atmoASL = 1 | ||
tempASL = 1 | ||
scanAltitude = 1 | ||
resizeBuildings = 0 | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System.Reflection; | ||
|
||
[assembly: AssemblyTitle("Sigma Dimensions")] | ||
[assembly: AssemblyDescription("The universal rescale mod for KSP.")] | ||
[assembly: AssemblyConfiguration("")] | ||
[assembly: AssemblyCompany("Sigma88")] | ||
[assembly: AssemblyProduct("")] | ||
[assembly: AssemblyCopyright("Copyright (C) Sigma88 2016")] | ||
[assembly: AssemblyTrademark("")] | ||
[assembly: AssemblyCulture("")] | ||
[assembly: KSPAssembly("SigmaDimensions", 1, 0)] | ||
[assembly: KSPAssemblyDependency("Kopernicus", 1, 0)] | ||
[assembly: AssemblyVersion("1.0.0")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
using UnityEngine; | ||
using Kopernicus; | ||
|
||
|
||
namespace SigmaDimensionsPlugin | ||
{ | ||
[KSPAddon(KSPAddon.Startup.MainMenu, true)] | ||
public class SigmaDimensions : MonoBehaviour | ||
{ | ||
public double resize = 1; | ||
public double landscape = 1; | ||
public double resizeBuildings = 1; | ||
public CelestialBody body = null; | ||
|
||
void Start() | ||
{ | ||
foreach (CelestialBody cb in FlightGlobals.Bodies) | ||
{ | ||
body = cb; | ||
resize = body.Has("resize") ? body.Get<double>("resize") : 1; | ||
landscape = body.Has("landscape") ? body.Get<double>("landscape") : 1; | ||
resizeBuildings = body.Has("resizeBuildings") ? body.Get<double>("resizeBuildings") : 1; | ||
|
||
foreach (PQSCity mod in body.GetComponentsInChildren<PQSCity>(true)) | ||
{ | ||
CityFixer(mod); | ||
} | ||
|
||
foreach (PQSCity2 mod in body.GetComponentsInChildren<PQSCity2>(true)) | ||
{ | ||
City2Fixer(mod); | ||
} | ||
} | ||
} | ||
|
||
void CityFixer(PQSCity pqs) | ||
{ | ||
double groundLevel = body.pqsController.GetSurfaceHeight(pqs.repositionRadial) - body.Radius; | ||
|
||
if (!pqs.repositionToSphere && !pqs.repositionToSphereSurface) | ||
{ | ||
// Offset = Distance from the center of the planet | ||
|
||
double fromRadius = pqs.repositionRadiusOffset - (body.Radius / resize); | ||
double builtInOffset = fromRadius - groundLevel / (resize * landscape); | ||
|
||
pqs.repositionRadiusOffset = body.Radius + groundLevel + builtInOffset * resizeBuildings; | ||
} | ||
if (pqs.repositionToSphere && !pqs.repositionToSphereSurface) | ||
{ | ||
// Offset = Distance from the radius of the planet | ||
|
||
double builtInOffset = pqs.repositionRadiusOffset - groundLevel / (resize * landscape); | ||
|
||
pqs.repositionRadiusOffset = groundLevel + builtInOffset * resizeBuildings; | ||
} | ||
if (pqs.repositionToSphereSurface && pqs.repositionToSphereSurfaceAddHeight && resizeBuildings != 1) | ||
{ | ||
// Offset = Distance from the surface of the planet | ||
|
||
pqs.repositionRadiusOffset *= resizeBuildings; | ||
} | ||
if (resizeBuildings != 1) | ||
{ | ||
// Resize the Building | ||
|
||
pqs.transform.localScale *= (float)resizeBuildings; | ||
} | ||
} | ||
|
||
void City2Fixer(PQSCity2 pqs) | ||
{ | ||
double groundLevel = body.pqsController.GetSurfaceHeight(pqs.PlanetRelativePosition) - body.Radius; | ||
|
||
if (!pqs.snapToSurface) | ||
{ | ||
// Offset = Distance from the center of the planet | ||
|
||
double fromRadius = pqs.alt - (body.Radius / resize); | ||
double builtInOffset = fromRadius - groundLevel / (resize * landscape); | ||
|
||
pqs.alt = body.Radius + groundLevel + builtInOffset * resizeBuildings; | ||
} | ||
else | ||
{ | ||
// Offset = Distance from the surface of the planet | ||
|
||
pqs.snapHeightOffset *= resizeBuildings; | ||
} | ||
if (resizeBuildings != 1) | ||
{ | ||
// Resize the Building | ||
|
||
pqs.transform.localScale *= (float)resizeBuildings; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="14.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')" /> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProjectGuid>{B3769F47-5A16-43C9-995F-1B3B15BE97CC}</ProjectGuid> | ||
<OutputType>Library</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>SigmaDimensionsPlugin</RootNamespace> | ||
<AssemblyName>SigmaDimensions</AssemblyName> | ||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion> | ||
<FileAlignment>512</FileAlignment> | ||
<TargetFrameworkProfile /> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>..\Distribution\</OutputPath> | ||
<DefineConstants>DEBUG;TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\Release\</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="SpaceCenterFixer.cs" /> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
<Compile Include="SigmaDimensions.cs" /> | ||
<Compile Include="SigmaDimensionsLoader.cs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Reference Include="Assembly-CSharp, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL"> | ||
<SpecificVersion>False</SpecificVersion> | ||
<HintPath>..\..\..\Sigma-Binary\[Source]\KerbalSpaceProgram\KSP_Data\Managed\Assembly-CSharp.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Kopernicus, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> | ||
<SpecificVersion>False</SpecificVersion> | ||
<HintPath>..\..\..\Sigma-Binary\[Source]\Kopernicus\Kopernicus.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Kopernicus.Components, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> | ||
<SpecificVersion>False</SpecificVersion> | ||
<HintPath>..\..\..\Sigma-Binary\[Source]\Kopernicus\Kopernicus.Components.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Kopernicus.OnDemand, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> | ||
<SpecificVersion>False</SpecificVersion> | ||
<HintPath>..\..\..\Sigma-Binary\[Source]\Kopernicus\Kopernicus.OnDemand.dll</HintPath> | ||
</Reference> | ||
<Reference Include="UnityEngine, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL"> | ||
<SpecificVersion>False</SpecificVersion> | ||
<HintPath>..\..\..\Sigma-Binary\[Source]\KerbalSpaceProgram\KSP_Data\Managed\UnityEngine.dll</HintPath> | ||
</Reference> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | ||
<!-- 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. | ||
<Target Name="BeforeBuild"> | ||
</Target> | ||
<Target Name="AfterBuild"> | ||
</Target> | ||
--> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio 14 | ||
VisualStudioVersion = 14.0.24720.0 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SigmaDimensions", "SigmaDimensions.csproj", "{B3769F47-5A16-43C9-995F-1B3B15BE97CC}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{B3769F47-5A16-43C9-995F-1B3B15BE97CC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{B3769F47-5A16-43C9-995F-1B3B15BE97CC}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{B3769F47-5A16-43C9-995F-1B3B15BE97CC}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{B3769F47-5A16-43C9-995F-1B3B15BE97CC}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
EndGlobal |
Oops, something went wrong.