commit bfc3a9faf3194f98fd6ee426795e378d0e7116b3
parent 68208af8386737a3d42621ca364c43a96065066b
Author: Mikolaj Lenczewski <33129490+EnderRifter@users.noreply.github.com>
Date: Mon, 8 Jul 2019 16:12:30 +0100
Minor changes to some code to tune orbit tracers.
Diffstat:
4 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/StarSim/StarSimLib/Constants.cs b/StarSim/StarSimLib/Constants.cs
@@ -10,7 +10,7 @@ namespace StarSimLib
/// <summary>
/// The amount of bodies that are rendered by default.
/// </summary>
- public const int BodyCount = 10;
+ public const int BodyCount = 100;
/// <summary>
/// The mass of the central body, if it is included.
@@ -66,10 +66,10 @@ namespace StarSimLib
/// <summary>
/// The number of previous positions that will be stored by a body
/// </summary>
- public const int StoredPreviousPositionCount = 100;
+ public const int StoredPreviousPositionCount = 50;
/// <summary>
- /// The time step for the simulation.
+ /// The default time step for the simulation.
/// </summary>
public const double TimeStep = SecondsPerTick * (SimulationRate / (float)FrameRate) * SimulationRate;
diff --git a/StarSim/StarSimLib/Data Structures/OrbitTracer.cs b/StarSim/StarSimLib/Data Structures/OrbitTracer.cs
@@ -10,9 +10,9 @@ namespace StarSimLib.Data_Structures
{
/// <summary>
/// Sample rate for the previous position. Used to improve performance and get a longer orbit tracer tail
- /// for less computation. The previous position will be saved once every 20 sampling opportunities.
+ /// for less computation. The previous position will be saved once every 15 sampling opportunities.
/// </summary>
- private const int PositionSampleRate = 10;
+ private const int PositionSampleRate = 15;
/// <summary>
/// Backing field for the <see cref="PreviousPositions"/> property.
diff --git a/StarSim/StarSimLib/Graphics/Drawer.cs b/StarSim/StarSimLib/Graphics/Drawer.cs
@@ -367,10 +367,10 @@ namespace StarSimLib.Graphics
{
Vector4[] orbitTracerPositions = body.OrbitTracer.PreviousPositions.ToArray();
- // we cache the colours used for the orbit tracers, and pack them into a 4D vector
- Color tracerColour = Color.Cyan, black = Color.Transparent;
+ // we cache the colours used for the orbit tracers and the background, and pack them into a 4D vector
+ Color tracerColour = Color.Cyan, bgColour = Color.Transparent;
Vector4 tracerVector = new Vector4(tracerColour.R, tracerColour.G, tracerColour.B, tracerColour.A);
- Vector4 blackVector = new Vector4(black.R, black.G, black.B, black.A);
+ Vector4 bgVector = new Vector4(bgColour.R, bgColour.G, bgColour.B, bgColour.A);
for (uint i = 0; i < orbitTracerPositions.Length; i++)
{
@@ -386,7 +386,7 @@ namespace StarSimLib.Graphics
// use linear interpolation to make the tail colour transition look smooth
Vector4 interpolatedColourVector =
- LinearInterpolate(tracerVector, blackVector, i / (double)orbitTracerPositions.Length);
+ LinearInterpolate(tracerVector, bgVector, i / (double)orbitTracerPositions.Length);
// unpack the colour from a vector into a colour
Color interpolatedColour = new Color(
diff --git a/StarSim/StarSimLib/StarSimLib.xml b/StarSim/StarSimLib/StarSimLib.xml
@@ -72,7 +72,7 @@
</member>
<member name="F:StarSimLib.Constants.TimeStep">
<summary>
- The time step for the simulation.
+ The default time step for the simulation.
</summary>
</member>
<member name="F:StarSimLib.Constants.TreeTheta">
@@ -688,7 +688,7 @@
<member name="F:StarSimLib.Data_Structures.OrbitTracer.PositionSampleRate">
<summary>
Sample rate for the previous position. Used to improve performance and get a longer orbit tracer tail
- for less computation. The previous position will be saved once every 20 sampling opportunities.
+ for less computation. The previous position will be saved once every 15 sampling opportunities.
</summary>
</member>
<member name="F:StarSimLib.Data_Structures.OrbitTracer.previousPositions">