Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mockingbirdnest/Principia
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 189e1890fd9b
Choose a base ref
...
head repository: mockingbirdnest/Principia
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: d047406986bc
Choose a head ref
  • 13 commits
  • 8 files changed
  • 3 contributors

Commits on Oct 2, 2021

  1. Copy the full SHA
    0d2ce62 View commit details
  2. possibly a different colour

    eggrobin committed Oct 2, 2021
    Copy the full SHA
    fca48cb View commit details

Commits on Oct 3, 2021

  1. Merge pull request #3135 from eggrobin/farbe

    Orbits of a possibly different colour
    eggrobin authored Oct 3, 2021
    Copy the full SHA
    0b797a3 View commit details
  2. Merge pull request #3134 from eggrobin/the-jupiter

    Use the translated celestial name in the celestial targeting UI
    eggrobin authored Oct 3, 2021
    Copy the full SHA
    8dc90b9 View commit details
  3. Next release is Halley.

    eggrobin committed Oct 3, 2021
    Copy the full SHA
    7cbbff0 View commit details
  4. Merge pull request #3138 from eggrobin/halley

    Next release is Halley
    eggrobin authored Oct 3, 2021
    Copy the full SHA
    541a52f View commit details

Commits on Oct 5, 2021

  1. Announce Hadamard.

    pleroy authored Oct 5, 2021
    Copy the full SHA
    ac6c0cb View commit details

Commits on Oct 6, 2021

  1. Fixed typo in readme.

    Hadamar -> Hadamard
    rnlahaye committed Oct 6, 2021
    Copy the full SHA
    29e41b4 View commit details
  2. Merge pull request #3139 from rnlahaye/hadamard

    Fixed typo in readme.
    pleroy authored Oct 6, 2021
    Copy the full SHA
    0b6a2cd View commit details

Commits on Oct 7, 2021

  1. Range.

    pleroy committed Oct 7, 2021
    Copy the full SHA
    42eb212 View commit details
  2. After egg's review.

    pleroy committed Oct 7, 2021
    Copy the full SHA
    5fb54be View commit details
  3. Merge pull request #3140 from pleroy/RangeIterator

    DiscreteTrajectorySegmentRange
    pleroy authored Oct 7, 2021
    Copy the full SHA
    6422bbe View commit details
  4. Merge.

    pleroy committed Oct 7, 2021
    Copy the full SHA
    d047406 View commit details
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Principia

**[Haar](https://github.com/mockingbirdnest/Principia/wiki/Change-Log#haar), the September version of Principia, is available, with improved UI and French localization. Download it [here for 1.8.1, 1.9.1, 1.10.1, 1.11.0, 1.11.1, 1.11.2, and 1.12.2](https://bit.ly/2YyfFP9).**
**[Hadamard](https://github.com/mockingbirdnest/Principia/wiki/Change-Log#hadamard), the October version of Principia, is available with UI fixes. Download it [here for 1.8.1, 1.9.1, 1.10.1, 1.11.0, 1.11.1, 1.11.2, and 1.12.2](https://bit.ly/3itb0VK).**

**For the convenience of Chinese users, downloads from 腾讯微云: [Principia Haar for 1.8.1—1.12.2](https://share.weiyun.com/OUu1p51e), [Trappist-1 for Principia](https://share.weiyun.com/5wVtWYQ).**
**For the convenience of Chinese users, downloads from 腾讯微云: [Principia Hadamard for 1.8.1—1.12.2](https://share.weiyun.com/qXuSrxCQ), [Trappist-1 for Principia](https://share.weiyun.com/5wVtWYQ).**

Principia is a mod for Kerbal Space Program (KSP) which implements N-body and extended body gravitation. Instead of being within the sphere of influence of a single celestial body at any point in time, your vessels are influenced by all the celestials. This makes it possible to implement missions that are more complex and more realistic than in the stock game, especially if used in conjunction with a mod like RealSolarSystem which has real-life celestials.

@@ -18,4 +18,4 @@ The [change log](https://github.com/mockingbirdnest/Principia/wiki/Change-Log) g

Principia is released on every [new moon](https://en.wikipedia.org/wiki/New_moon) with whatever features and bug fixes are ready at the time. This ensures relatively timely improvements and bug fixes.

Download the binary (Ubuntu, macOS, and Windows) [here for 1.8.1, 1.9.1, 1.10.1, 1.11.0, 1.11.1, 1.11.2, and 1.12.2](https://bit.ly/2YyfFP9). Download the [“Trappist-1 for Principia”](https://github.com/mockingbirdnest/Principia/wiki/Installing,-reporting-bugs,-and-frequently-asked-questions#installing-trappist-1-for-principia) mini-mod [here](https://bit.ly/2ZHf3Tt). Or, if you don't trust our binary, [build the mod](https://github.com/mockingbirdnest/Principia/blob/master/documentation/Setup.md) from the [Haar](https://github.com/mockingbirdnest/Principia/releases/tag/2021090701-Haar) release.
Download the binary (Ubuntu, macOS, and Windows) [here for 1.8.1, 1.9.1, 1.10.1, 1.11.0, 1.11.1, 1.11.2, and 1.12.2](https://bit.ly/3itb0VK). Download the [“Trappist-1 for Principia”](https://github.com/mockingbirdnest/Principia/wiki/Installing,-reporting-bugs,-and-frequently-asked-questions#installing-trappist-1-for-principia) mini-mod [here](https://bit.ly/2ZHf3Tt). Or, if you don't trust our binary, [build the mod](https://github.com/mockingbirdnest/Principia/blob/master/documentation/Setup.md) from the [Hadamard](https://github.com/mockingbirdnest/Principia/releases/tag/2021100611-Hadamard) release.
2 changes: 1 addition & 1 deletion ksp_plugin_adapter/ksp_plugin_adapter.cs
Original file line number Diff line number Diff line change
@@ -2240,7 +2240,7 @@ private void PlotCelestialTrajectories(DisposablePlanetarium planetarium,
if (plotting_frame_selector_.FixesBody(celestial)) {
continue;
}
var colour = celestial.MapObject?.uiNode?.VisualIconData.color ??
var colour = celestial.orbitDriver?.Renderer?.orbitColor ??
XKCDColors.SunshineYellow;
if (colour.a != 1) {
// When zoomed into a planetary system, the trajectory of the
8 changes: 4 additions & 4 deletions ksp_plugin_adapter/main_window.cs
Original file line number Diff line number Diff line change
@@ -6,10 +6,10 @@ namespace ksp_plugin_adapter {

internal class MainWindow : VesselSupervisedWindowRenderer {
// Update this section before each release.
private const string next_release_name = "Hadamard";
private const int next_release_lunation_number = 269;
private const string next_release_name = "Halley";
private const int next_release_lunation_number = 270;
private readonly DateTimeOffset next_release_date_ =
new DateTimeOffset(2021, 10, 06, 11, 04, 00, TimeSpan.Zero);
new DateTimeOffset(2021, 11, 04, 21, 14, 00, TimeSpan.Zero);

public MainWindow(PrincipiaPluginAdapter adapter,
FlightPlanner flight_planner,
@@ -259,7 +259,7 @@ private void RenderKSPFeatures() {
if (target_celestial != null) {
UnityEngine.GUILayout.Label(
Localizer.Format("#Principia_MainWindow_TargetCelestial_Name",
target_celestial.name),
target_celestial.Name()),
UnityEngine.GUILayout.ExpandWidth(true));
if (UnityEngine.GUILayout.Button(
Localizer.Format("#Principia_MainWindow_TargetCelestial_Clear"),
21 changes: 13 additions & 8 deletions physics/discrete_trajectory_segment_range.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#pragma once

#include <list>
#include <memory>
#include <cstdint>

#include "absl/container/btree_map.h"
#include "geometry/named_quantities.hpp"
@@ -11,27 +10,33 @@ namespace principia {
namespace physics {
namespace internal_discrete_trajectory_segment_range {

using geometry::Instant;
using physics::DegreesOfFreedom;

// A range of segments in a DiscreteTrajectory, iterator upon using |Iterator|.
// Convenient for range-based loops.
// TODO(phl): Move to base or use the Ranges library if it turns out that this
// class doesn't need to know more about trajectories.
template<typename Iterator>
class DiscreteTrajectorySegmentRange {
public:
DiscreteTrajectorySegmentRange() = default;
DiscreteTrajectorySegmentRange(Iterator begin, Iterator end);

Iterator begin() const;
Iterator end() const;

bool empty() const;
std::int64_t size() const;

private:
Iterator begin_;
Iterator end_;
};

} // namespace internal_discrete_trajectory_segment_range

template<typename Iterator>
using DiscreteTrajectorySegmentRange =
internal_discrete_trajectory_segment_range::DiscreteTrajectorySegmentRange;
using internal_discrete_trajectory_segment_range::
DiscreteTrajectorySegmentRange;

} // namespace physics
} // namespace principia

#include "physics/discrete_trajectory_segment_range_body.hpp"
39 changes: 39 additions & 0 deletions physics/discrete_trajectory_segment_range_body.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#pragma once

#include "physics/discrete_trajectory_segment_range.hpp"

#include <iterator>

namespace principia {
namespace physics {
namespace internal_discrete_trajectory_segment_range {

template<typename Iterator>
DiscreteTrajectorySegmentRange<Iterator>::DiscreteTrajectorySegmentRange(
Iterator const begin,
Iterator const end)
: begin_(begin), end_(end) {}

template<typename Iterator>
Iterator DiscreteTrajectorySegmentRange<Iterator>::begin() const {
return begin_;
}

template<typename Iterator>
Iterator DiscreteTrajectorySegmentRange<Iterator>::end() const {
return end_;
}

template<typename Iterator>
inline bool DiscreteTrajectorySegmentRange<Iterator>::empty() const {
return begin_ == end_;
}

template<typename Iterator>
inline std::int64_t DiscreteTrajectorySegmentRange<Iterator>::size() const {
return std::distance(begin_, end_);
}

} // namespace internal_discrete_trajectory_segment_range
} // namespace physics
} // namespace principia
29 changes: 29 additions & 0 deletions physics/discrete_trajectory_segment_range_test.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#include "physics/discrete_trajectory_segment_range.hpp"

#include <vector>

#include "gtest/gtest.h"

namespace principia {
namespace physics {

TEST(DiscreteTrajectorySegmentRangeTest, Basic) {
std::vector<int> const primes{2, 3, 5, 7, 11, 13, 17, 19, 23};
DiscreteTrajectorySegmentRange<std::vector<int>::const_iterator> range(
primes.begin(), primes.end());

int sum = 0;
int product = 1;
for (int const prime : range) {
sum += prime;
product *= prime;
}
EXPECT_EQ(100, sum);
EXPECT_EQ(223'092'870, product);

EXPECT_EQ(9, primes.size());
EXPECT_FALSE(primes.empty());
}

} // namespace physics
} // namespace principia
2 changes: 2 additions & 0 deletions physics/physics.vcxproj
Original file line number Diff line number Diff line change
@@ -37,6 +37,7 @@
<ClInclude Include="discrete_trajectory_segment_iterator.hpp" />
<ClInclude Include="discrete_trajectory_segment_range.hpp" />
<ClInclude Include="discrete_trajectory_types.hpp" />
<ClInclude Include="discrete_trajectory_segment_range_body.hpp" />
<ClInclude Include="mechanical_system.hpp" />
<ClInclude Include="mechanical_system_body.hpp" />
<ClInclude Include="continuous_trajectory_body.hpp" />
@@ -98,6 +99,7 @@
<ClCompile Include="body_surface_frame_field_test.cpp" />
<ClCompile Include="body_test.cpp" />
<ClCompile Include="checkpointer_test.cpp" />
<ClCompile Include="discrete_trajectory_segment_range_test.cpp" />
<ClCompile Include="mechanical_system_test.cpp" />
<ClCompile Include="continuous_trajectory_test.cpp" />
<ClCompile Include="degrees_of_freedom_test.cpp" />
6 changes: 6 additions & 0 deletions physics/physics.vcxproj.filters
Original file line number Diff line number Diff line change
@@ -209,6 +209,9 @@
<ClInclude Include="discrete_trajectory_segment_range.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="discrete_trajectory_segment_range_body.hpp">
<Filter>Source Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="degrees_of_freedom_test.cpp">
@@ -307,5 +310,8 @@
<ClCompile Include="..\geometry\instant_output.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="discrete_trajectory_segment_range_test.cpp">
<Filter>Test Files</Filter>
</ClCompile>
</ItemGroup>
</Project>