commit a9eb778eabc5ee1d86d2ee041dd706f01c632ae8 parent 1a4451c46a11344ba76c2b8c98ed34c27022cc79 Author: Mikolaj Lenczewski <33129490+EnderRifter@users.noreply.github.com> Date: Wed, 3 Jul 2019 21:30:49 +0100 Renamed Vector4d to Vector4. Started work on Barnes-Hut algorithm implementation. Diffstat:
14 files changed, 738 insertions(+), 693 deletions(-)
diff --git a/StarSim/StarSim/Program.cs b/StarSim/StarSim/Program.cs @@ -66,7 +66,7 @@ namespace StarSim #if DEBUG bodyPositionUpdater = BodyUpdater.UpdateBodiesBruteForce; #else - bodyPositionUpdater = BodyUpdater.UpdateBodiesBruteForce; + bodyPositionUpdater = BodyUpdater.UpdateBodiesBarnesHut; #endif bodyDrawer = new Drawer(window, ref bodies, ref bodyShapeMap); inputHandler = new InputHandler(ref bodies, ref bodyDrawer); diff --git a/StarSim/StarSimLib/Constants.cs b/StarSim/StarSimLib/Constants.cs @@ -11,7 +11,7 @@ namespace StarSimLib /// <summary> /// The amount of bodies that are rendered by default. /// </summary> - public const int BodyCount = 10; + public const int BodyCount = 10000; /// <summary> /// The mass of the central body, if it is included. diff --git a/StarSim/StarSimLib/Data Structures/Body.cs b/StarSim/StarSimLib/Data Structures/Body.cs @@ -21,7 +21,7 @@ namespace StarSimLib.Data_Structures /// <summary> /// The backing field for the <see cref="Force"/> property. /// </summary> - private Vector4d force; + private Vector4 force; /// <summary> /// Backing field for the <see cref="Mass"/> property. @@ -31,12 +31,12 @@ namespace StarSimLib.Data_Structures /// <summary> /// Backing field for the <see cref="Position"/> property. /// </summary> - private Vector4d position; + private Vector4 position; /// <summary> /// Backing field for the <see cref="Velocity"/> property. /// </summary> - private Vector4d velocity; + private Vector4 velocity; /// <summary> /// The generation that this body belongs to. @@ -56,7 +56,7 @@ namespace StarSimLib.Data_Structures /// <param name="mass">The starting mass of the <see cref="Body"/>.</param> /// <param name="generation">The generation that this <see cref="Body"/> belongs to.</param> /// <param name="id">The unique id for this body.</param> - public Body(Vector4d position, Vector4d velocity, double mass, uint generation = 1, uint id = 1) + public Body(Vector4 position, Vector4 velocity, double mass, uint generation = 1, uint id = 1) { Generation = generation; Id = id; @@ -66,14 +66,14 @@ namespace StarSimLib.Data_Structures this.velocity = velocity; this.mass = mass; - force = new Vector4d(); + force = new Vector4(); orbitTracer = new OrbitTracer(); } /// <summary> /// The current force on the <see cref="Body"/> in 3D space. /// </summary> - public Vector4d Force + public Vector4 Force { get { return force; } } @@ -97,7 +97,7 @@ namespace StarSimLib.Data_Structures /// <summary> /// The current position of the <see cref="Body"/> in 3D space. /// </summary> - public Vector4d Position + public Vector4 Position { get { return position; } } @@ -110,7 +110,7 @@ namespace StarSimLib.Data_Structures /// <summary> /// The current velocity of the <see cref="Body"/> in 3D space. /// </summary> - public Vector4d Velocity + public Vector4 Velocity { get { return velocity; } } @@ -121,7 +121,7 @@ namespace StarSimLib.Data_Structures /// <param name="a">The first <see cref="Body"/> instance.</param> /// <param name="b">The second <see cref="Body"/> instance.</param> /// <returns></returns> - public static Vector4d GetForceBetween(Body a, Body b) + public static Vector4 GetForceBetween(Body a, Body b) { // Inlines the Body.DistanceTo(Body) as the position deltas need to be cached for later, // as well as to gain a small performance increase @@ -140,7 +140,7 @@ namespace StarSimLib.Data_Structures // with a softening factor, we get the attraction force vector between the 2 bodies double force = numerator / denominator; - return new Vector4d(force * dx / distance, force * dy / distance, force * dz / distance); + return new Vector4(force * dx / distance, force * dy / distance, force * dz / distance); } /// <summary> @@ -170,13 +170,13 @@ namespace StarSimLib.Data_Structures /// <param name="body">The other <see cref="Body"/> instance to which to calculate the distance.</param> /// <param name="displacement">The vector showing the displacement of the current body from the given one.</param> /// <returns>The distance to the other <see cref="Body"/> as a <see cref="float"/>.</returns> - public double DistanceTo(Body body, out Vector4d displacement) + public double DistanceTo(Body body, out Vector4 displacement) { double dpx = body.Position.X - Position.X, dpy = body.Position.Y - Position.Y, dpz = body.Position.Z - Position.Z; - displacement = new Vector4d(dpx, dpy, dpz); + displacement = new Vector4(dpx, dpy, dpz); return Math.Sqrt(dpx * dpx + dpy * dpy + dpz * dpz); } @@ -212,7 +212,7 @@ namespace StarSimLib.Data_Structures /// </summary> /// <param name="forceVector">The sum vector of all forces due to other <see cref="Body"/>s.</param> /// <param name="deltaTime">The time step.</param> - public void Update(Vector4d forceVector, double deltaTime) + public void Update(Vector4 forceVector, double deltaTime) { velocity += deltaTime * forceVector / mass; diff --git a/StarSim/StarSimLib/Data Structures/Matrix4x4.cs b/StarSim/StarSimLib/Data Structures/Matrix4x4.cs @@ -124,15 +124,15 @@ namespace StarSimLib.Data_Structures } /// <summary> - /// Implements the multiplication operator for a <see cref="Matrix4x4"/> and a <see cref="Vector4d"/>. This is + /// Implements the multiplication operator for a <see cref="Matrix4x4"/> and a <see cref="Vector4"/>. This is /// the 'dot' operation for a vector and a matrix. /// </summary> /// <param name="matrix4x4">The matrix.</param> /// <param name="vector">The 3D vector.</param> - /// <returns>The dot product of the <see cref="Matrix4x4"/> and the <see cref="Vector4d"/>.</returns> - public static Vector4d operator *(Matrix4x4 matrix4x4, Vector4d vector) + /// <returns>The dot product of the <see cref="Matrix4x4"/> and the <see cref="Vector4"/>.</returns> + public static Vector4 operator *(Matrix4x4 matrix4x4, Vector4 vector) { - return new Vector4d + return new Vector4 { X = vector.X * matrix4x4[0, 0] + vector.Y * matrix4x4[1, 0] + @@ -154,13 +154,13 @@ namespace StarSimLib.Data_Structures } /// <summary> - /// Implements the multiplication operator for a <see cref="Matrix4x4"/> and a <see cref="Vector4d"/>. This is + /// Implements the multiplication operator for a <see cref="Matrix4x4"/> and a <see cref="Vector4"/>. This is /// the 'dot' operation for a vector and a matrix. /// </summary> /// <param name="vector">The 3D vector.</param> /// <param name="matrix4x4">The matrix.</param> - /// <returns>The dot product of the <see cref="Matrix4x4"/> and the <see cref="Vector4d"/>.</returns> - public static Vector4d operator *(Vector4d vector, Matrix4x4 matrix4x4) => matrix4x4 * vector; + /// <returns>The dot product of the <see cref="Matrix4x4"/> and the <see cref="Vector4"/>.</returns> + public static Vector4 operator *(Vector4 vector, Matrix4x4 matrix4x4) => matrix4x4 * vector; #region Overrides of ValueType diff --git a/StarSim/StarSimLib/Data Structures/Octant.cs b/StarSim/StarSimLib/Data Structures/Octant.cs @@ -0,0 +1,10 @@ +namespace StarSimLib.Data_Structures +{ + /// <summary> + /// Represents an octant of 3D space. + /// </summary> + public class Octant + { + Vector4 + } +} +\ No newline at end of file diff --git a/StarSim/StarSimLib/Data Structures/OctantTree.cs b/StarSim/StarSimLib/Data Structures/OctantTree.cs @@ -0,0 +1,9 @@ +namespace StarSimLib.Data_Structures +{ + /// <summary> + /// A tree of <see cref="Octant"/> instances, where each node has 8 children. + /// </summary> + public class OctantTree + { + } +} +\ No newline at end of file diff --git a/StarSim/StarSimLib/Data Structures/OrbitTracer.cs b/StarSim/StarSimLib/Data Structures/OrbitTracer.cs @@ -18,13 +18,13 @@ namespace StarSimLib.Data_Structures /// <summary> /// Backing field for the <see cref="PreviousPositions"/> property. /// </summary> - private readonly Queue<Vector4d> previousPositions; + private readonly Queue<Vector4> previousPositions; /// <summary> /// Due to the <see cref="Queue{T}"/>s inability to fetch the second-to-last element, we must explicitly /// cache it in order to use it in interpolation calculations later. /// </summary> - private Vector4d dequeuedPosition; + private Vector4 dequeuedPosition; /// <summary> /// Counts the number of sampling opportunities that have gone by since the last position sample. Resets once @@ -37,13 +37,13 @@ namespace StarSimLib.Data_Structures /// </summary> public OrbitTracer() { - previousPositions = new Queue<Vector4d>(Constants.StoredPreviousPositionCount); + previousPositions = new Queue<Vector4>(Constants.StoredPreviousPositionCount); } /// <summary> - /// An <see cref="Queue{T}"/> containing previous <see cref="Vector4d"/> positions of the body. + /// An <see cref="Queue{T}"/> containing previous <see cref="Vector4"/> positions of the body. /// </summary> - public ref readonly Queue<Vector4d> PreviousPositions + public ref readonly Queue<Vector4> PreviousPositions { get { return ref previousPositions; } } @@ -62,7 +62,7 @@ namespace StarSimLib.Data_Structures /// value in <see cref="Constants.StoredPreviousPositionCount"/>. Will only enqueue the /// current position if the <see cref="PositionSampleRate"/> is met. /// </summary> - public void Enqueue(Vector4d position) + public void Enqueue(Vector4 position) { // if the sample rate limit has not yet been met, don't sample a position but instead edit the last stored // position using linear interpolation to give a smooth shrinking motion diff --git a/StarSim/StarSimLib/Data Structures/Vector4.cs b/StarSim/StarSimLib/Data Structures/Vector4.cs @@ -0,0 +1,461 @@ +using System; +using System.Diagnostics.Contracts; + +namespace StarSimLib.Data_Structures +{ + /// <summary> + /// A 4D vector with <see cref="double"/> components. + /// </summary> + public struct Vector4 + { + /// <summary> + /// The w component of the vector. + /// </summary> + public double W; + + /// <summary> + /// The x component of the vector. + /// </summary> + public double X; + + /// <summary> + /// The y component of the vector. + /// </summary> + public double Y; + + /// <summary> + /// The z component of the vector. + /// </summary> + public double Z; + + /// <summary> + /// Initialises a new instance of the <see cref="Vector4"/> struct. Sets Z and W to 0. + /// </summary> + /// <param name="x">The x component.</param> + /// <param name="y">The y component.</param> + public Vector4(double x, double y) + { + X = x; + Y = y; + Z = 0; + W = 0; + } + + /// <summary> + /// Initialises a new instance of the <see cref="Vector4"/> struct. Sets W to 0. + /// </summary> + /// <param name="x">The x component.</param> + /// <param name="y">The y component.</param> + /// <param name="z">The z component.</param> + public Vector4(double x, double y, double z) + { + X = x; + Y = y; + Z = z; + W = 0; + } + + /// <summary> + /// Initialises a new instance of the <see cref="Vector4"/> struct. + /// </summary> + /// <param name="x">The x component.</param> + /// <param name="y">The y component.</param> + /// <param name="z">The z component.</param> + /// <param name="w">The w component.</param> + public Vector4(double x, double y, double z, double w) + { + X = x; + Y = y; + Z = z; + W = w; + } + + #region Operator Overloads + + /// <summary> + /// Implements the subtraction operator for 2 <see cref="Vector4"/>s. + /// </summary> + /// <param name="vector">The original <see cref="Vector4"/>.</param> + /// <param name="vector2">The other <see cref="Vector4"/>.</param> + /// <returns>The new <see cref="Vector4"/>.</returns> + public static Vector4 operator -(Vector4 vector, Vector4 vector2) + { + vector.X -= vector2.X; + vector.Y -= vector2.Y; + vector.Z -= vector2.Z; + vector.W -= vector2.W; + + return vector; + } + + /// <summary> + /// Implements the subtraction operator for a <see cref="Vector4"/> and a (X, Y, Z, W) tuple. + /// </summary> + /// <param name="vector">The original <see cref="Vector4"/>.</param> + /// <param name="vector2">The 4D tuple.</param> + /// <returns>The new <see cref="Vector4"/>.</returns> + public static Vector4 operator -(Vector4 vector, (double X, double Y, double Z, double W) vector2) + { + (double x, double y, double z, double w) = vector2; + + vector.X -= x; + vector.Y -= y; + vector.Z -= z; + vector.W -= w; + + return vector; + } + + /// <summary> + /// Implements the subtraction operator for a <see cref="Vector4"/> and a (X, Y, Z, W) tuple. + /// </summary> + /// <param name="vector">The original <see cref="Vector4"/>.</param> + /// <param name="vector2">The 4D tuple.</param> + /// <returns>The new <see cref="Vector4"/>.</returns> + public static Vector4 operator -((double X, double Y, double Z, double W) vector2, Vector4 vector) => vector - vector2; + + /// <summary> + /// Implements the subtraction operator for a <see cref="Vector4"/> and a scalar <see cref="double"/> value. + /// </summary> + /// <param name="vector">The original <see cref="Vector4"/>.</param> + /// <param name="scalar">The scalar <see cref="double"/>.</param> + /// <returns>The new <see cref="Vector4"/>.</returns> + public static Vector4 operator -(Vector4 vector, double scalar) + { + vector.X -= scalar; + vector.Y -= scalar; + vector.Z -= scalar; + vector.W -= scalar; + + return vector; + } + + /// <summary> + /// Implements the subtraction operator for a <see cref="Vector4"/> and a scalar <see cref="double"/> value. + /// </summary> + /// <param name="vector">The original <see cref="Vector4"/>.</param> + /// <param name="scalar">The scalar <see cref="double"/>.</param> + /// <returns>The new <see cref="Vector4"/>.</returns> + public static Vector4 operator -(double scalar, Vector4 vector) => vector - scalar; + + /// <summary> + /// Implements the multiplication operator for 2 <see cref="Vector4"/>s. + /// </summary> + /// <param name="vector">The original <see cref="Vector4"/>.</param> + /// <param name="vector2">The other <see cref="Vector4"/>.</param> + /// <returns>The new <see cref="Vector4"/>.</returns> + public static Vector4 operator *(Vector4 vector, Vector4 vector2) + { + vector.X *= vector2.X; + vector.Y *= vector2.Y; + vector.Z *= vector2.Z; + vector.W *= vector2.W; + + return vector; + } + + /// <summary> + /// Implements the multiplication operator for a <see cref="Vector4"/> and a (X, Y, Z, W) tuple. + /// </summary> + /// <param name="vector">The original <see cref="Vector4"/>.</param> + /// <param name="vector2">The 4D tuple.</param> + /// <returns>The new <see cref="Vector4"/>.</returns> + public static Vector4 operator *(Vector4 vector, (double X, double Y, double Z, double W) vector2) + { + (double x, double y, double z, double w) = vector2; + + vector.X *= x; + vector.Y *= y; + vector.Z *= z; + vector.W *= w; + + return vector; + } + + /// <summary> + /// Implements the multiplication operator for a <see cref="Vector4"/> and a (X, Y, Z, W) tuple. + /// </summary> + /// <param name="vector">The original <see cref="Vector4"/>.</param> + /// <param name="vector2">The 4D tuple.</param> + /// <returns>The new <see cref="Vector4"/>.</returns> + public static Vector4 operator *((double X, double Y, double Z, double W) vector2, Vector4 vector) => vector * vector2; + + /// <summary> + /// Implements the multiplication operator for a <see cref="Vector4"/> and a scalar <see cref="double"/> value. + /// </summary> + /// <param name="vector">The original <see cref="Vector4"/>.</param> + /// <param name="scalar">The scalar <see cref="double"/>.</param> + /// <returns>The new <see cref="Vector4"/>.</returns> + public static Vector4 operator *(Vector4 vector, double scalar) + { + vector.X *= scalar; + vector.Y *= scalar; + vector.Z *= scalar; + vector.W *= scalar; + + return vector; + } + + /// <summary> + /// Implements the multiplication operator for a <see cref="Vector4"/> and a scalar <see cref="double"/> value. + /// </summary> + /// <param name="vector">The original <see cref="Vector4"/>.</param> + /// <param name="scalar">The scalar <see cref="double"/>.</param> + /// <returns>The new <see cref="Vector4"/>.</returns> + public static Vector4 operator *(double scalar, Vector4 vector) => vector * scalar; + + /// <summary> + /// Implements the division operator for 2 <see cref="Vector4"/>s. + /// </summary> + /// <param name="vector">The original <see cref="Vector4"/>.</param> + /// <param name="vector2">The other <see cref="Vector4"/>.</param> + /// <returns>The new <see cref="Vector4"/>.</returns> + public static Vector4 operator /(Vector4 vector, Vector4 vector2) + { + vector.X /= vector2.X; + vector.Y /= vector2.Y; + vector.Z /= vector2.Z; + vector.W /= vector2.W; + + return vector; + } + + /// <summary> + /// Implements the division operator for a <see cref="Vector4"/> and a (X, Y, Z, W) tuple. + /// </summary> + /// <param name="vector">The original <see cref="Vector4"/>.</param> + /// <param name="vector2">The 4D tuple.</param> + /// <returns>The new <see cref="Vector4"/>.</returns> + public static Vector4 operator /(Vector4 vector, (double X, double Y, double Z, double W) vector2) + { + (double x, double y, double z, double w) = vector2; + + vector.X /= x; + vector.Y /= y; + vector.Z /= z; + vector.W /= w; + + return vector; + } + + /// <summary> + /// Implements the division operator for a <see cref="Vector4"/> and a (X, Y, Z, W) tuple. + /// </summary> + /// <param name="vector">The original <see cref="Vector4"/>.</param> + /// <param name="vector2">The 4D tuple.</param> + /// <returns>The new <see cref="Vector4"/>.</returns> + public static Vector4 operator /((double X, double Y, double Z, double W) vector2, Vector4 vector) => vector / vector2; + + /// <summary> + /// Implements the division operator for a <see cref="Vector4"/> and a scalar <see cref="double"/> value. + /// </summary> + /// <param name="vector">The original <see cref="Vector4"/>.</param> + /// <param name="scalar">The scalar <see cref="double"/>.</param> + /// <returns>The new <see cref="Vector4"/>.</returns> + public static Vector4 operator /(Vector4 vector, double scalar) + { + vector.X /= scalar; + vector.Y /= scalar; + vector.Z /= scalar; + vector.W /= scalar; + + return vector; + } + + /// <summary> + /// Implements the division operator for a <see cref="Vector4"/> and a scalar <see cref="double"/> value. + /// </summary> + /// <param name="vector">The original <see cref="Vector4"/>.</param> + /// <param name="scalar">The scalar <see cref="double"/>.</param> + /// <returns>The new <see cref="Vector4"/>.</returns> + public static Vector4 operator /(double scalar, Vector4 vector) => vector / scalar; + + /// <summary> + /// Implements the addition operator for 2 <see cref="Vector4"/>s. + /// </summary> + /// <param name="vector">The original <see cref="Vector4"/>.</param> + /// <param name="vector2">The other <see cref="Vector4"/>.</param> + /// <returns>The new <see cref="Vector4"/>.</returns> + public static Vector4 operator +(Vector4 vector, Vector4 vector2) + { + vector.X += vector2.X; + vector.Y += vector2.Y; + vector.Z += vector2.Z; + vector.W += vector2.W; + + return vector; + } + + /// <summary> + /// Implements the addition operator for a <see cref="Vector4"/> and a (X, Y, Z, W) tuple. + /// </summary> + /// <param name="vector">The original <see cref="Vector4"/>.</param> + /// <param name="vector2">The 4D tuple.</param> + /// <returns>The new <see cref="Vector4"/>.</returns> + public static Vector4 operator +(Vector4 vector, (double X, double Y, double Z, double W) vector2) + { + (double x, double y, double z, double w) = vector2; + + vector.X += x; + vector.Y += y; + vector.Z += z; + vector.W += w; + + return vector; + } + + /// <summary> + /// Implements the addition operator for a <see cref="Vector4"/> and a (X, Y, Z, W) tuple. + /// </summary> + /// <param name="vector">The original <see cref="Vector4"/>.</param> + /// <param name="vector2">The 4D tuple.</param> + /// <returns>The new <see cref="Vector4"/>.</returns> + public static Vector4 operator +((double X, double Y, double Z, double W) vector2, Vector4 vector) => vector + vector2; + + /// <summary> + /// Implements the addition operator for a <see cref="Vector4"/> and a scalar <see cref="double"/> value. + /// </summary> + /// <param name="vector">The original <see cref="Vector4"/>.</param> + /// <param name="scalar">The scalar <see cref="double"/>.</param> + /// <returns>The new <see cref="Vector4"/>.</returns> + public static Vector4 operator +(Vector4 vector, double scalar) + { + vector.X += scalar; + vector.Y += scalar; + vector.Z += scalar; + vector.W += scalar; + + return vector; + } + + /// <summary> + /// Implements the addition operator for a <see cref="Vector4"/> and a scalar <see cref="double"/> value. + /// </summary> + /// <param name="vector">The original <see cref="Vector4"/>.</param> + /// <param name="scalar">The scalar <see cref="double"/>.</param> + /// <returns>The new <see cref="Vector4"/>.</returns> + public static Vector4 operator +(double scalar, Vector4 vector) => vector + scalar; + + #endregion Operator Overloads + + /// <summary> + /// Indexes the vector as a 1D array. + /// </summary> + /// <param name="i">The column index.</param> + /// <returns>The value at the specified field.</returns> + public double this[int i] + { + get + { + switch (i) + { + case 0: + return X; + + case 1: + return Y; + + case 2: + return Z; + + case 3: + return W; + + default: + return 0; + } + } + + set + { + switch (i) + { + case 0: + X = value; + break; + + case 1: + Y = value; + break; + + case 2: + Z = value; + break; + + case 3: + W = value; + break; + + default: + break; + } + } + } + + /// <summary> + /// Returns the absolute value of this <see cref="Vector4"/>. + /// </summary> + /// <returns>The absolute value (magnitude) of this <see cref="Vector4"/>, as a <see cref="double"/>.</returns> + [Pure] + public double Abs() + { + return Math.Sqrt(X * X + Y * Y + Z * Z + W * W); + } + + /// <summary> + /// Returns the magnitude of this <see cref="Vector4"/>. + /// </summary> + /// <returns>The magnitude (absolute value) of this <see cref="Vector4"/>, as a <see cref="double"/>.</returns> + [Pure] + public double Magnitude() + { + return Abs(); + } + + /// <summary> + /// Holds unit vectors. + /// </summary> + public static class UnitVectors + { + /// <summary> + /// The negative unit vector for the Z axis. + /// </summary> + public static readonly Vector4 Backwards = new Vector4(0, 0, -1); + + /// <summary> + /// The negative unit vector for the Y axis. + /// </summary> + public static readonly Vector4 Down = new Vector4(0, -1, 0); + + /// <summary> + /// The positive unit vector for the Z axis. + /// </summary> + public static readonly Vector4 Forwards = new Vector4(0, 0, 1); + + /// <summary> + /// The positive unit vector for the X axis. + /// </summary> + public static readonly Vector4 Left = new Vector4(1, 0, 0); + + /// <summary> + /// The negative unit vector for the X axis. + /// </summary> + public static readonly Vector4 Right = new Vector4(-1, 0, 0); + + /// <summary> + /// The positive unit vector for the Y axis. + /// </summary> + public static readonly Vector4 Up = new Vector4(0, 1, 0); + } + + #region Overrides of ValueType + + /// <inheritdoc /> + public override string ToString() + { + return $"[{X}, {Y}, {Z}, {W}]"; + } + + #endregion Overrides of ValueType + } +} +\ No newline at end of file diff --git a/StarSim/StarSimLib/Data Structures/Vector4d.cs b/StarSim/StarSimLib/Data Structures/Vector4d.cs @@ -1,461 +0,0 @@ -using System; -using System.Diagnostics.Contracts; - -namespace StarSimLib.Data_Structures -{ - /// <summary> - /// A 4D vector with <see cref="double"/> components. - /// </summary> - public struct Vector4d - { - /// <summary> - /// The w component of the vector. - /// </summary> - public double W; - - /// <summary> - /// The x component of the vector. - /// </summary> - public double X; - - /// <summary> - /// The y component of the vector. - /// </summary> - public double Y; - - /// <summary> - /// The z component of the vector. - /// </summary> - public double Z; - - /// <summary> - /// Initialises a new instance of the <see cref="Vector4d"/> struct. Sets Z and W to 0. - /// </summary> - /// <param name="x">The x component.</param> - /// <param name="y">The y component.</param> - public Vector4d(double x, double y) - { - X = x; - Y = y; - Z = 0; - W = 0; - } - - /// <summary> - /// Initialises a new instance of the <see cref="Vector4d"/> struct. Sets W to 0. - /// </summary> - /// <param name="x">The x component.</param> - /// <param name="y">The y component.</param> - /// <param name="z">The z component.</param> - public Vector4d(double x, double y, double z) - { - X = x; - Y = y; - Z = z; - W = 0; - } - - /// <summary> - /// Initialises a new instance of the <see cref="Vector4d"/> struct. - /// </summary> - /// <param name="x">The x component.</param> - /// <param name="y">The y component.</param> - /// <param name="z">The z component.</param> - /// <param name="w">The w component.</param> - public Vector4d(double x, double y, double z, double w) - { - X = x; - Y = y; - Z = z; - W = w; - } - - #region Operator Overloads - - /// <summary> - /// Implements the subtraction operator for 2 <see cref="Vector4d"/>s. - /// </summary> - /// <param name="vector">The original <see cref="Vector4d"/>.</param> - /// <param name="vector2">The other <see cref="Vector4d"/>.</param> - /// <returns>The new <see cref="Vector4d"/>.</returns> - public static Vector4d operator -(Vector4d vector, Vector4d vector2) - { - vector.X -= vector2.X; - vector.Y -= vector2.Y; - vector.Z -= vector2.Z; - vector.W -= vector2.W; - - return vector; - } - - /// <summary> - /// Implements the subtraction operator for a <see cref="Vector4d"/> and a (X, Y, Z, W) tuple. - /// </summary> - /// <param name="vector">The original <see cref="Vector4d"/>.</param> - /// <param name="vector2">The 4D tuple.</param> - /// <returns>The new <see cref="Vector4d"/>.</returns> - public static Vector4d operator -(Vector4d vector, (double X, double Y, double Z, double W) vector2) - { - (double x, double y, double z, double w) = vector2; - - vector.X -= x; - vector.Y -= y; - vector.Z -= z; - vector.W -= w; - - return vector; - } - - /// <summary> - /// Implements the subtraction operator for a <see cref="Vector4d"/> and a (X, Y, Z, W) tuple. - /// </summary> - /// <param name="vector">The original <see cref="Vector4d"/>.</param> - /// <param name="vector2">The 4D tuple.</param> - /// <returns>The new <see cref="Vector4d"/>.</returns> - public static Vector4d operator -((double X, double Y, double Z, double W) vector2, Vector4d vector) => vector - vector2; - - /// <summary> - /// Implements the subtraction operator for a <see cref="Vector4d"/> and a scalar <see cref="double"/> value. - /// </summary> - /// <param name="vector">The original <see cref="Vector4d"/>.</param> - /// <param name="scalar">The scalar <see cref="double"/>.</param> - /// <returns>The new <see cref="Vector4d"/>.</returns> - public static Vector4d operator -(Vector4d vector, double scalar) - { - vector.X -= scalar; - vector.Y -= scalar; - vector.Z -= scalar; - vector.W -= scalar; - - return vector; - } - - /// <summary> - /// Implements the subtraction operator for a <see cref="Vector4d"/> and a scalar <see cref="double"/> value. - /// </summary> - /// <param name="vector">The original <see cref="Vector4d"/>.</param> - /// <param name="scalar">The scalar <see cref="double"/>.</param> - /// <returns>The new <see cref="Vector4d"/>.</returns> - public static Vector4d operator -(double scalar, Vector4d vector) => vector - scalar; - - /// <summary> - /// Implements the multiplication operator for 2 <see cref="Vector4d"/>s. - /// </summary> - /// <param name="vector">The original <see cref="Vector4d"/>.</param> - /// <param name="vector2">The other <see cref="Vector4d"/>.</param> - /// <returns>The new <see cref="Vector4d"/>.</returns> - public static Vector4d operator *(Vector4d vector, Vector4d vector2) - { - vector.X *= vector2.X; - vector.Y *= vector2.Y; - vector.Z *= vector2.Z; - vector.W *= vector2.W; - - return vector; - } - - /// <summary> - /// Implements the multiplication operator for a <see cref="Vector4d"/> and a (X, Y, Z, W) tuple. - /// </summary> - /// <param name="vector">The original <see cref="Vector4d"/>.</param> - /// <param name="vector2">The 4D tuple.</param> - /// <returns>The new <see cref="Vector4d"/>.</returns> - public static Vector4d operator *(Vector4d vector, (double X, double Y, double Z, double W) vector2) - { - (double x, double y, double z, double w) = vector2; - - vector.X *= x; - vector.Y *= y; - vector.Z *= z; - vector.W *= w; - - return vector; - } - - /// <summary> - /// Implements the multiplication operator for a <see cref="Vector4d"/> and a (X, Y, Z, W) tuple. - /// </summary> - /// <param name="vector">The original <see cref="Vector4d"/>.</param> - /// <param name="vector2">The 4D tuple.</param> - /// <returns>The new <see cref="Vector4d"/>.</returns> - public static Vector4d operator *((double X, double Y, double Z, double W) vector2, Vector4d vector) => vector * vector2; - - /// <summary> - /// Implements the multiplication operator for a <see cref="Vector4d"/> and a scalar <see cref="double"/> value. - /// </summary> - /// <param name="vector">The original <see cref="Vector4d"/>.</param> - /// <param name="scalar">The scalar <see cref="double"/>.</param> - /// <returns>The new <see cref="Vector4d"/>.</returns> - public static Vector4d operator *(Vector4d vector, double scalar) - { - vector.X *= scalar; - vector.Y *= scalar; - vector.Z *= scalar; - vector.W *= scalar; - - return vector; - } - - /// <summary> - /// Implements the multiplication operator for a <see cref="Vector4d"/> and a scalar <see cref="double"/> value. - /// </summary> - /// <param name="vector">The original <see cref="Vector4d"/>.</param> - /// <param name="scalar">The scalar <see cref="double"/>.</param> - /// <returns>The new <see cref="Vector4d"/>.</returns> - public static Vector4d operator *(double scalar, Vector4d vector) => vector * scalar; - - /// <summary> - /// Implements the division operator for 2 <see cref="Vector4d"/>s. - /// </summary> - /// <param name="vector">The original <see cref="Vector4d"/>.</param> - /// <param name="vector2">The other <see cref="Vector4d"/>.</param> - /// <returns>The new <see cref="Vector4d"/>.</returns> - public static Vector4d operator /(Vector4d vector, Vector4d vector2) - { - vector.X /= vector2.X; - vector.Y /= vector2.Y; - vector.Z /= vector2.Z; - vector.W /= vector2.W; - - return vector; - } - - /// <summary> - /// Implements the division operator for a <see cref="Vector4d"/> and a (X, Y, Z, W) tuple. - /// </summary> - /// <param name="vector">The original <see cref="Vector4d"/>.</param> - /// <param name="vector2">The 4D tuple.</param> - /// <returns>The new <see cref="Vector4d"/>.</returns> - public static Vector4d operator /(Vector4d vector, (double X, double Y, double Z, double W) vector2) - { - (double x, double y, double z, double w) = vector2; - - vector.X /= x; - vector.Y /= y; - vector.Z /= z; - vector.W /= w; - - return vector; - } - - /// <summary> - /// Implements the division operator for a <see cref="Vector4d"/> and a (X, Y, Z, W) tuple. - /// </summary> - /// <param name="vector">The original <see cref="Vector4d"/>.</param> - /// <param name="vector2">The 4D tuple.</param> - /// <returns>The new <see cref="Vector4d"/>.</returns> - public static Vector4d operator /((double X, double Y, double Z, double W) vector2, Vector4d vector) => vector / vector2; - - /// <summary> - /// Implements the division operator for a <see cref="Vector4d"/> and a scalar <see cref="double"/> value. - /// </summary> - /// <param name="vector">The original <see cref="Vector4d"/>.</param> - /// <param name="scalar">The scalar <see cref="double"/>.</param> - /// <returns>The new <see cref="Vector4d"/>.</returns> - public static Vector4d operator /(Vector4d vector, double scalar) - { - vector.X /= scalar; - vector.Y /= scalar; - vector.Z /= scalar; - vector.W /= scalar; - - return vector; - } - - /// <summary> - /// Implements the division operator for a <see cref="Vector4d"/> and a scalar <see cref="double"/> value. - /// </summary> - /// <param name="vector">The original <see cref="Vector4d"/>.</param> - /// <param name="scalar">The scalar <see cref="double"/>.</param> - /// <returns>The new <see cref="Vector4d"/>.</returns> - public static Vector4d operator /(double scalar, Vector4d vector) => vector / scalar; - - /// <summary> - /// Implements the addition operator for 2 <see cref="Vector4d"/>s. - /// </summary> - /// <param name="vector">The original <see cref="Vector4d"/>.</param> - /// <param name="vector2">The other <see cref="Vector4d"/>.</param> - /// <returns>The new <see cref="Vector4d"/>.</returns> - public static Vector4d operator +(Vector4d vector, Vector4d vector2) - { - vector.X += vector2.X; - vector.Y += vector2.Y; - vector.Z += vector2.Z; - vector.W += vector2.W; - - return vector; - } - - /// <summary> - /// Implements the addition operator for a <see cref="Vector4d"/> and a (X, Y, Z, W) tuple. - /// </summary> - /// <param name="vector">The original <see cref="Vector4d"/>.</param> - /// <param name="vector2">The 4D tuple.</param> - /// <returns>The new <see cref="Vector4d"/>.</returns> - public static Vector4d operator +(Vector4d vector, (double X, double Y, double Z, double W) vector2) - { - (double x, double y, double z, double w) = vector2; - - vector.X += x; - vector.Y += y; - vector.Z += z; - vector.W += w; - - return vector; - } - - /// <summary> - /// Implements the addition operator for a <see cref="Vector4d"/> and a (X, Y, Z, W) tuple. - /// </summary> - /// <param name="vector">The original <see cref="Vector4d"/>.</param> - /// <param name="vector2">The 4D tuple.</param> - /// <returns>The new <see cref="Vector4d"/>.</returns> - public static Vector4d operator +((double X, double Y, double Z, double W) vector2, Vector4d vector) => vector + vector2; - - /// <summary> - /// Implements the addition operator for a <see cref="Vector4d"/> and a scalar <see cref="double"/> value. - /// </summary> - /// <param name="vector">The original <see cref="Vector4d"/>.</param> - /// <param name="scalar">The scalar <see cref="double"/>.</param> - /// <returns>The new <see cref="Vector4d"/>.</returns> - public static Vector4d operator +(Vector4d vector, double scalar) - { - vector.X += scalar; - vector.Y += scalar; - vector.Z += scalar; - vector.W += scalar; - - return vector; - } - - /// <summary> - /// Implements the addition operator for a <see cref="Vector4d"/> and a scalar <see cref="double"/> value. - /// </summary> - /// <param name="vector">The original <see cref="Vector4d"/>.</param> - /// <param name="scalar">The scalar <see cref="double"/>.</param> - /// <returns>The new <see cref="Vector4d"/>.</returns> - public static Vector4d operator +(double scalar, Vector4d vector) => vector + scalar; - - #endregion Operator Overloads - - /// <summary> - /// Indexes the vector as a 1D array. - /// </summary> - /// <param name="i">The column index.</param> - /// <returns>The value at the specified field.</returns> - public double this[int i] - { - get - { - switch (i) - { - case 0: - return X; - - case 1: - return Y; - - case 2: - return Z; - - case 3: - return W; - - default: - return 0; - } - } - - set - { - switch (i) - { - case 0: - X = value; - break; - - case 1: - Y = value; - break; - - case 2: - Z = value; - break; - - case 3: - W = value; - break; - - default: - break; - } - } - } - - /// <summary> - /// Returns the absolute value of this <see cref="Vector4d"/>. - /// </summary> - /// <returns>The absolute value (magnitude) of this <see cref="Vector4d"/>, as a <see cref="double"/>.</returns> - [Pure] - public double Abs() - { - return Math.Sqrt(X * X + Y * Y + Z * Z + W * W); - } - - /// <summary> - /// Returns the magnitude of this <see cref="Vector4d"/>. - /// </summary> - /// <returns>The magnitude (absolute value) of this <see cref="Vector4d"/>, as a <see cref="double"/>.</returns> - [Pure] - public double Magnitude() - { - return Abs(); - } - - /// <summary> - /// Holds unit vectors. - /// </summary> - public static class UnitVectors - { - /// <summary> - /// The negative unit vector for the Z axis. - /// </summary> - public static readonly Vector4d Backwards = new Vector4d(0, 0, -1); - - /// <summary> - /// The negative unit vector for the Y axis. - /// </summary> - public static readonly Vector4d Down = new Vector4d(0, -1, 0); - - /// <summary> - /// The positive unit vector for the Z axis. - /// </summary> - public static readonly Vector4d Forwards = new Vector4d(0, 0, 1); - - /// <summary> - /// The positive unit vector for the X axis. - /// </summary> - public static readonly Vector4d Left = new Vector4d(1, 0, 0); - - /// <summary> - /// The negative unit vector for the X axis. - /// </summary> - public static readonly Vector4d Right = new Vector4d(-1, 0, 0); - - /// <summary> - /// The positive unit vector for the Y axis. - /// </summary> - public static readonly Vector4d Up = new Vector4d(0, 1, 0); - } - - #region Overrides of ValueType - - /// <inheritdoc /> - public override string ToString() - { - return $"[{X}, {Y}, {Z}, {W}]"; - } - - #endregion Overrides of ValueType - } -} -\ No newline at end of file diff --git a/StarSim/StarSimLib/Graphics/Drawer.cs b/StarSim/StarSimLib/Graphics/Drawer.cs @@ -73,7 +73,7 @@ namespace StarSimLib.Graphics /// <summary> /// The vector by which all projected points are translated away from the camera and halfway into the view frustum. /// </summary> - private static readonly Vector4d cameraTranslationVector = new Vector4d(0, 0, (FarDistance - NearDistance) / 2); + private static readonly Vector4 cameraTranslationVector = new Vector4(0, 0, (FarDistance - NearDistance) / 2); /// <summary> /// The aspect ratio of the render target. Allows for normalisation of the <see cref="RenderTarget"/> space @@ -255,14 +255,14 @@ namespace StarSimLib.Graphics } /// <summary> - /// Projects the given <see cref="Vector4d"/> point from world space into screen space. + /// Projects the given <see cref="Vector4"/> point from world space into screen space. /// </summary> /// <param name="point">The point to project.</param> /// <returns>The projected point.</returns> - private Vector4d ProjectPoint(Vector4d point) + private Vector4 ProjectPoint(Vector4 point) { // rotations should happen before the point is translated into camera space - Vector4d worldSpace = point; + Vector4 worldSpace = point; // rotations of point in the x, y and z axes worldSpace *= zRotationMatrix; @@ -272,10 +272,10 @@ namespace StarSimLib.Graphics // points must be translated into the camera space, as the camera must be some distance away from the // world space origin (0,0,0) or else rendering breaks. the point is translated into the middle of the // camera space (the view frustum) - Vector4d cameraSpace = worldSpace + cameraTranslationVector; + Vector4 cameraSpace = worldSpace + cameraTranslationVector; // project the point position from camera space into screen space (without any special transformations) - Vector4d projectedPosition = cameraSpace * projectionMatrix; + Vector4 projectedPosition = cameraSpace * projectionMatrix; if (!projectedPosition.W.Equals(0)) { @@ -285,7 +285,7 @@ namespace StarSimLib.Graphics } // any transformations can be applied now - Vector4d screenPosition = projectedPosition; + Vector4 screenPosition = projectedPosition; return screenPosition; } @@ -340,14 +340,14 @@ namespace StarSimLib.Graphics // otherwise, we skip the relatively expensive rendering code if (body.RecordPreviousPositions) { - Vector4d[] orbitTracerPositions = body.OrbitTracer.PreviousPositions.ToArray(); + Vector4[] orbitTracerPositions = body.OrbitTracer.PreviousPositions.ToArray(); for (uint i = 0; i < orbitTracerPositions.Length; i++) { - Vector4d previousPosition = orbitTracerPositions[i]; + Vector4 previousPosition = orbitTracerPositions[i]; // project previous position onto the screen - Vector4d pointScreenPosition = ProjectPoint(previousPosition); + Vector4 pointScreenPosition = ProjectPoint(previousPosition); // convert the final position into a Vector2f, useable by the SFML.NET Vertex struct Vector2f finalOrbitTracerPosition = new Vector2f( @@ -364,7 +364,7 @@ namespace StarSimLib.Graphics orbitTracerVertexArray.Draw(renderTarget, RenderStates.Default); } - Vector4d screenPosition = ProjectPoint(body.Position); + Vector4 screenPosition = ProjectPoint(body.Position); // final position shape.Position = new Vector2f( diff --git a/StarSim/StarSimLib/Physics/BodyGenerator.cs b/StarSim/StarSimLib/Physics/BodyGenerator.cs @@ -64,8 +64,8 @@ namespace StarSimLib.Physics { float mass = (float)(Rng.NextDouble() * Constants.SolarMass); - Vector4d position = OrbitGenerator.RandomPosition(); - Vector4d velocity = OrbitGenerator.RandomOrbit(position); + Vector4 position = OrbitGenerator.RandomPosition(); + Vector4 velocity = OrbitGenerator.RandomOrbit(position); generatedBodies[i] = new Body(position, velocity, mass, CurrentGeneration, id); @@ -74,7 +74,7 @@ namespace StarSimLib.Physics if (centralAttractor && bodyCount >= 2) { - generatedBodies[0] = new Body(new Vector4d(), new Vector4d(), Constants.CentralBodyMass, CurrentGeneration, 0); + generatedBodies[0] = new Body(new Vector4(), new Vector4(), Constants.CentralBodyMass, CurrentGeneration, 0); } return generatedBodies; diff --git a/StarSim/StarSimLib/Physics/BodyUpdater.cs b/StarSim/StarSimLib/Physics/BodyUpdater.cs @@ -21,10 +21,34 @@ namespace StarSimLib.Physics /// </summary> /// <param name="bodies">The collection of <see cref="Body"/>s whose positions to update.</param> /// <param name="deltaTime">The time step.</param> + public static void UpdateBodiesBarnesHut(IEnumerable<Body> bodies, double deltaTime) + { + IEnumerable<Body> bodyEnumerable = bodies as Body[] ?? bodies.ToArray(); + Vector4 forceVector = new Vector4(); + + foreach (Body body in bodyEnumerable) + { + // resets the force vector to avoid another instantiation and allocation + forceVector.X = 0; + forceVector.Y = 0; + forceVector.Z = 0; + + // use LINQ expression as it is more concise; sum attraction vectors for all other bodies + forceVector = bodyEnumerable.Where(b => b != body).Aggregate(forceVector, (current, b) => current + Body.GetForceBetween(body, b)); + + body.Update(forceVector, deltaTime); + } + } + + /// <summary> + /// Updates the positions of all the given <see cref="Body"/>s with O(n^2) time complexity, with the given time step. + /// </summary> + /// <param name="bodies">The collection of <see cref="Body"/>s whose positions to update.</param> + /// <param name="deltaTime">The time step.</param> public static void UpdateBodiesBruteForce(IEnumerable<Body> bodies, double deltaTime) { IEnumerable<Body> bodyEnumerable = bodies as Body[] ?? bodies.ToArray(); - Vector4d forceVector = new Vector4d(); + Vector4 forceVector = new Vector4(); foreach (Body body in bodyEnumerable) { diff --git a/StarSim/StarSimLib/Physics/OrbitGenerator.cs b/StarSim/StarSimLib/Physics/OrbitGenerator.cs @@ -18,9 +18,9 @@ namespace StarSimLib.Physics /// </summary> /// <param name="positionVector">The position vector for the body for which to generate the orbit.</param> /// <returns>The magnitude of the velocity of the orbit.</returns> - public static Vector4d RandomOrbit(Vector4d positionVector) + public static Vector4 RandomOrbit(Vector4 positionVector) { - Vector4d position = positionVector; + Vector4 position = positionVector; // F = G m1 - m2 / distance double distanceToCentralBody = position.Magnitude(); @@ -43,21 +43,21 @@ namespace StarSimLib.Physics vz = 0; // Randomly orient the orbit - return !(Rng.NextDouble() <= 0.5f) ? new Vector4d(vx, vy, vz) : new Vector4d(-vx, -vy, -vz); + return !(Rng.NextDouble() <= 0.5f) ? new Vector4(vx, vy, vz) : new Vector4(-vx, -vy, -vz); } /// <summary> /// Returns a random position within the universe sphere (see <see cref="Constants.UniverseSize"/>). /// </summary> /// <returns>A 3D position vector.</returns> - public static Vector4d RandomPosition() + public static Vector4 RandomPosition() { double RandomPos() { return Constants.UniverseSize * Math.Exp(-1.8) * (.5 - Rng.NextDouble()); } - return new Vector4d(RandomPos(), RandomPos(), RandomPos()); + return new Vector4(RandomPos(), RandomPos(), RandomPos()); } } } \ No newline at end of file diff --git a/StarSim/StarSimLib/StarSimLib.xml b/StarSim/StarSimLib/StarSimLib.xml @@ -46,7 +46,7 @@ </member> <member name="F:StarSimLib.Constants.SofteningFactor"> <summary> - Softens the force between <see cref="T:StarSimLib.Physics.Body"/>s to avoid infinities. + Softens the force between <see cref="T:StarSimLib.Data_Structures.Body"/>s to avoid infinities. </summary> </member> <member name="F:StarSimLib.Constants.SofteningFactor2"> @@ -71,7 +71,7 @@ </member> <member name="F:StarSimLib.Constants.UniverseSize"> <summary> - The maximum radius within which <see cref="T:StarSimLib.Physics.Body"/>s will be placed (1e18f). + The maximum radius within which <see cref="T:StarSimLib.Data_Structures.Body"/>s will be placed (1e18f). </summary> </member> <member name="F:StarSimLib.Constants.ZoomStep"> @@ -106,6 +106,142 @@ <member name="M:StarSimLib.Contexts.SimulatorContext.OnModelCreating(Microsoft.EntityFrameworkCore.ModelBuilder)"> <inheritdoc /> </member> + <member name="T:StarSimLib.Data_Structures.Body"> + <summary> + Represents a stellar body. + </summary> + </member> + <member name="F:StarSimLib.Data_Structures.Body.BodyFormatString"> + <summary> + Describes how the <see cref="T:StarSimLib.Data_Structures.Body"/> instance should be formatted as a <see cref="T:System.String"/>. + </summary> + </member> + <member name="F:StarSimLib.Data_Structures.Body.orbitTracer"> + <summary> + The orbit tracers for this instance. + </summary> + </member> + <member name="F:StarSimLib.Data_Structures.Body.force"> + <summary> + The backing field for the <see cref="P:StarSimLib.Data_Structures.Body.Force"/> property. + </summary> + </member> + <member name="F:StarSimLib.Data_Structures.Body.mass"> + <summary> + Backing field for the <see cref="P:StarSimLib.Data_Structures.Body.Mass"/> property. + </summary> + </member> + <member name="F:StarSimLib.Data_Structures.Body.position"> + <summary> + Backing field for the <see cref="P:StarSimLib.Data_Structures.Body.Position"/> property. + </summary> + </member> + <member name="F:StarSimLib.Data_Structures.Body.velocity"> + <summary> + Backing field for the <see cref="P:StarSimLib.Data_Structures.Body.Velocity"/> property. + </summary> + </member> + <member name="F:StarSimLib.Data_Structures.Body.Generation"> + <summary> + The generation that this body belongs to. + </summary> + </member> + <member name="F:StarSimLib.Data_Structures.Body.Id"> + <summary> + The unique id for this body. + </summary> + </member> + <member name="M:StarSimLib.Data_Structures.Body.#ctor(StarSimLib.Data_Structures.Vector4d,StarSimLib.Data_Structures.Vector4d,System.Double,System.UInt32,System.UInt32)"> + <summary> + Initialises a new instance of the <see cref="T:StarSimLib.Data_Structures.Body"/> class. + </summary> + <param name="position">The starting position of the <see cref="T:StarSimLib.Data_Structures.Body"/>.</param> + <param name="velocity">The starting velocity of the <see cref="T:StarSimLib.Data_Structures.Body"/>.</param> + <param name="mass">The starting mass of the <see cref="T:StarSimLib.Data_Structures.Body"/>.</param> + <param name="generation">The generation that this <see cref="T:StarSimLib.Data_Structures.Body"/> belongs to.</param> + <param name="id">The unique id for this body.</param> + </member> + <member name="P:StarSimLib.Data_Structures.Body.Force"> + <summary> + The current force on the <see cref="T:StarSimLib.Data_Structures.Body"/> in 3D space. + </summary> + </member> + <member name="P:StarSimLib.Data_Structures.Body.Mass"> + <summary> + The mass of the <see cref="T:StarSimLib.Data_Structures.Body"/>. + </summary> + </member> + <member name="P:StarSimLib.Data_Structures.Body.OrbitTracer"> + <summary> + The <see cref="T:StarSimLib.Data_Structures.OrbitTracer"/> for this instance. + </summary> + </member> + <member name="P:StarSimLib.Data_Structures.Body.Position"> + <summary> + The current position of the <see cref="T:StarSimLib.Data_Structures.Body"/> in 3D space. + </summary> + </member> + <member name="P:StarSimLib.Data_Structures.Body.RecordPreviousPositions"> + <summary> + Whether to record previous positions of this instance, to render an orbit tracer behind it. + </summary> + </member> + <member name="P:StarSimLib.Data_Structures.Body.Velocity"> + <summary> + The current velocity of the <see cref="T:StarSimLib.Data_Structures.Body"/> in 3D space. + </summary> + </member> + <member name="M:StarSimLib.Data_Structures.Body.GetForceBetween(StarSimLib.Data_Structures.Body,StarSimLib.Data_Structures.Body)"> + <summary> + Gets the force vector for the attraction between <see cref="T:StarSimLib.Data_Structures.Body"/> A and <see cref="T:StarSimLib.Data_Structures.Body"/> B. + </summary> + <param name="a">The first <see cref="T:StarSimLib.Data_Structures.Body"/> instance.</param> + <param name="b">The second <see cref="T:StarSimLib.Data_Structures.Body"/> instance.</param> + <returns></returns> + </member> + <member name="M:StarSimLib.Data_Structures.Body.AddForce(StarSimLib.Data_Structures.Body)"> + <summary> + Calculates the force between this instance and the given other body, and adds the resultant vector to the + internal total force vector. + </summary> + <param name="otherBody">The other body to calculate the force between.</param> + </member> + <member name="M:StarSimLib.Data_Structures.Body.Collide(StarSimLib.Data_Structures.Body)"> + <summary> + Collides this instance with the given <see cref="T:StarSimLib.Data_Structures.Body"/> instance. + </summary> + <param name="otherBody">The other instance with which to collide.</param> + </member> + <member name="M:StarSimLib.Data_Structures.Body.DistanceTo(StarSimLib.Data_Structures.Body,StarSimLib.Data_Structures.Vector4d@)"> + <summary> + Finds and returns the distance between the current <see cref="T:StarSimLib.Data_Structures.Body"/> instance and the given <see cref="T:StarSimLib.Data_Structures.Body"/>. + In other words, it finds the magnitude of the translation vector between the two <see cref="T:StarSimLib.Data_Structures.Body"/> instances. + </summary> + <param name="body">The other <see cref="T:StarSimLib.Data_Structures.Body"/> instance to which to calculate the distance.</param> + <param name="displacement">The vector showing the displacement of the current body from the given one.</param> + <returns>The distance to the other <see cref="T:StarSimLib.Data_Structures.Body"/> as a <see cref="T:System.Single"/>.</returns> + </member> + <member name="M:StarSimLib.Data_Structures.Body.ResetForce"> + <summary> + Resets the internal force vector. + </summary> + </member> + <member name="M:StarSimLib.Data_Structures.Body.Update(System.Double)"> + <summary> + Updates the <see cref="P:StarSimLib.Data_Structures.Body.Position"/> of the current body using the internal force vector and the given time step. + </summary> + <param name="deltaTime">The time step.</param> + </member> + <member name="M:StarSimLib.Data_Structures.Body.Update(StarSimLib.Data_Structures.Vector4d,System.Double)"> + <summary> + Updates the <see cref="P:StarSimLib.Data_Structures.Body.Position"/> of the current body using the given force vector and time step. + </summary> + <param name="forceVector">The sum vector of all forces due to other <see cref="T:StarSimLib.Data_Structures.Body"/>s.</param> + <param name="deltaTime">The time step.</param> + </member> + <member name="M:StarSimLib.Data_Structures.Body.ToString"> + <inheritdoc /> + </member> <member name="T:StarSimLib.Data_Structures.EulerAngle"> <summary> Represents a set of 3 angles, that together describe a 3D rotation. @@ -236,8 +372,8 @@ </member> <member name="T:StarSimLib.Data_Structures.OrbitTracer"> <summary> - Represents a series of points denoting the previous positions of a <see cref="T:StarSimLib.Physics.Body"/> instance. Used to render - an orbit tracer behind the <see cref="T:StarSimLib.Physics.Body"/>. + Represents a series of points denoting the previous positions of a <see cref="T:StarSimLib.Data_Structures.Body"/> instance. Used to render + an orbit tracer behind the <see cref="T:StarSimLib.Data_Structures.Body"/>. </summary> </member> <member name="F:StarSimLib.Data_Structures.OrbitTracer.PositionSampleRate"> @@ -645,19 +781,19 @@ </member> <member name="F:StarSimLib.Graphics.Drawer.managedBodies"> <summary> - Holds all the <see cref="T:StarSimLib.Physics.Body"/> instances that should be simulated. + Holds all the <see cref="T:StarSimLib.Data_Structures.Body"/> instances that should be simulated. </summary> </member> <member name="F:StarSimLib.Graphics.Drawer.managedBodyShapeMap"> <summary> - Maps a <see cref="T:StarSimLib.Physics.Body"/> to the <see cref="T:SFML.Graphics.CircleShape"/> that represents it, and is drawn to the - screen at the <see cref="T:StarSimLib.Physics.Body"/>s position. + Maps a <see cref="T:StarSimLib.Data_Structures.Body"/> to the <see cref="T:SFML.Graphics.CircleShape"/> that represents it, and is drawn to the + screen at the <see cref="T:StarSimLib.Data_Structures.Body"/>s position. </summary> </member> <member name="F:StarSimLib.Graphics.Drawer.managedBodyTracerVertexArrayMap"> <summary> - Maps a <see cref="T:StarSimLib.Physics.Body"/> to the <see cref="T:SFML.Graphics.VertexArray"/> that holds its orbit tracer vertices, and - is drawn to the screen behind the <see cref="T:StarSimLib.Physics.Body"/> instance. + Maps a <see cref="T:StarSimLib.Data_Structures.Body"/> to the <see cref="T:SFML.Graphics.VertexArray"/> that holds its orbit tracer vertices, and + is drawn to the screen behind the <see cref="T:StarSimLib.Data_Structures.Body"/> instance. </summary> </member> <member name="F:StarSimLib.Graphics.Drawer.originOffset"> @@ -701,17 +837,17 @@ The rotation matrix for the z axis. </summary> </member> - <member name="M:StarSimLib.Graphics.Drawer.#ctor(SFML.Graphics.RenderTarget,StarSimLib.Physics.Body[]@,System.Collections.Generic.Dictionary{StarSimLib.Physics.Body,SFML.Graphics.CircleShape}@)"> + <member name="M:StarSimLib.Graphics.Drawer.#ctor(SFML.Graphics.RenderTarget,StarSimLib.Data_Structures.Body[]@,System.Collections.Generic.Dictionary{StarSimLib.Data_Structures.Body,SFML.Graphics.CircleShape}@)"> <summary> Initialises a new instance of the <see cref="T:StarSimLib.Graphics.Drawer"/> class. </summary> <param name="target">The target to which the managed bodies should be rendered.</param> <param name="bodies"> - A reference to the <see cref="T:StarSimLib.Physics.Body"/> instances which should be managed by this instance. + A reference to the <see cref="T:StarSimLib.Data_Structures.Body"/> instances which should be managed by this instance. </param> <param name="bodyShapeMap"> - A reference to the dictionary mapping a <see cref="T:StarSimLib.Physics.Body"/> instance to the <see cref="T:SFML.Graphics.CircleShape"/> that - represents it, and is drawn to the screen at the <see cref="T:StarSimLib.Physics.Body"/> instance's position. + A reference to the dictionary mapping a <see cref="T:StarSimLib.Data_Structures.Body"/> instance to the <see cref="T:SFML.Graphics.CircleShape"/> that + represents it, and is drawn to the screen at the <see cref="T:StarSimLib.Data_Structures.Body"/> instance's position. </param> </member> <member name="P:StarSimLib.Graphics.Drawer.InverseScaleFactor"> @@ -758,7 +894,7 @@ </member> <member name="M:StarSimLib.Graphics.Drawer.DrawBodies"> <summary> - Draws each <see cref="T:StarSimLib.Physics.Body"/> instance that is managed by this drawer to the <see cref="T:SFML.Graphics.RenderTarget"/> specified + Draws each <see cref="T:StarSimLib.Data_Structures.Body"/> instance that is managed by this drawer to the <see cref="T:SFML.Graphics.RenderTarget"/> specified in the constructor, using the current view settings (rotation, zoom, etc.) to project the positions from 3D to 2D. This method should be called every frame, as without it the view isn't updated and neither are rotation or zoom. </summary> @@ -776,159 +912,23 @@ </summary> <param name="scaleMultiplier">The multiplier by which to scale the viewport of this instances render target.</param> </member> - <member name="T:StarSimLib.Physics.Body"> - <summary> - Represents a stellar body. - </summary> - </member> - <member name="F:StarSimLib.Physics.Body.BodyFormatString"> - <summary> - Describes how the <see cref="T:StarSimLib.Physics.Body"/> instance should be formatted as a <see cref="T:System.String"/>. - </summary> - </member> - <member name="F:StarSimLib.Physics.Body.orbitTracer"> - <summary> - The orbit tracers for this instance. - </summary> - </member> - <member name="F:StarSimLib.Physics.Body.force"> - <summary> - The backing field for the <see cref="P:StarSimLib.Physics.Body.Force"/> property. - </summary> - </member> - <member name="F:StarSimLib.Physics.Body.mass"> - <summary> - Backing field for the <see cref="P:StarSimLib.Physics.Body.Mass"/> property. - </summary> - </member> - <member name="F:StarSimLib.Physics.Body.position"> - <summary> - Backing field for the <see cref="P:StarSimLib.Physics.Body.Position"/> property. - </summary> - </member> - <member name="F:StarSimLib.Physics.Body.velocity"> - <summary> - Backing field for the <see cref="P:StarSimLib.Physics.Body.Velocity"/> property. - </summary> - </member> - <member name="F:StarSimLib.Physics.Body.Generation"> - <summary> - The generation that this body belongs to. - </summary> - </member> - <member name="F:StarSimLib.Physics.Body.Id"> - <summary> - The unique id for this body. - </summary> - </member> - <member name="M:StarSimLib.Physics.Body.#ctor(StarSimLib.Data_Structures.Vector4d,StarSimLib.Data_Structures.Vector4d,System.Double,System.UInt32,System.UInt32)"> - <summary> - Initialises a new instance of the <see cref="T:StarSimLib.Physics.Body"/> class. - </summary> - <param name="position">The starting position of the <see cref="T:StarSimLib.Physics.Body"/>.</param> - <param name="velocity">The starting velocity of the <see cref="T:StarSimLib.Physics.Body"/>.</param> - <param name="mass">The starting mass of the <see cref="T:StarSimLib.Physics.Body"/>.</param> - <param name="generation">The generation that this <see cref="T:StarSimLib.Physics.Body"/> belongs to.</param> - <param name="id">The unique id for this body.</param> - </member> - <member name="P:StarSimLib.Physics.Body.Force"> - <summary> - The current force on the <see cref="T:StarSimLib.Physics.Body"/> in 3D space. - </summary> - </member> - <member name="P:StarSimLib.Physics.Body.Mass"> - <summary> - The mass of the <see cref="T:StarSimLib.Physics.Body"/>. - </summary> - </member> - <member name="P:StarSimLib.Physics.Body.OrbitTracer"> - <summary> - The <see cref="T:StarSimLib.Data_Structures.OrbitTracer"/> for this instance. - </summary> - </member> - <member name="P:StarSimLib.Physics.Body.Position"> - <summary> - The current position of the <see cref="T:StarSimLib.Physics.Body"/> in 3D space. - </summary> - </member> - <member name="P:StarSimLib.Physics.Body.RecordPreviousPositions"> - <summary> - Whether to record previous positions of this instance, to render an orbit tracer behind it. - </summary> - </member> - <member name="P:StarSimLib.Physics.Body.Velocity"> - <summary> - The current velocity of the <see cref="T:StarSimLib.Physics.Body"/> in 3D space. - </summary> - </member> - <member name="M:StarSimLib.Physics.Body.GetForceBetween(StarSimLib.Physics.Body,StarSimLib.Physics.Body)"> - <summary> - Gets the force vector for the attraction between <see cref="T:StarSimLib.Physics.Body"/> A and <see cref="T:StarSimLib.Physics.Body"/> B. - </summary> - <param name="a">The first <see cref="T:StarSimLib.Physics.Body"/> instance.</param> - <param name="b">The second <see cref="T:StarSimLib.Physics.Body"/> instance.</param> - <returns></returns> - </member> - <member name="M:StarSimLib.Physics.Body.AddForce(StarSimLib.Physics.Body)"> - <summary> - Calculates the force between this instance and the given other body, and adds the resultant vector to the - internal total force vector. - </summary> - <param name="otherBody">The other body to calculate the force between.</param> - </member> - <member name="M:StarSimLib.Physics.Body.Collide(StarSimLib.Physics.Body)"> - <summary> - Collides this instance with the given <see cref="T:StarSimLib.Physics.Body"/> instance. - </summary> - <param name="otherBody">The other instance with which to collide.</param> - </member> - <member name="M:StarSimLib.Physics.Body.DistanceTo(StarSimLib.Physics.Body,StarSimLib.Data_Structures.Vector4d@)"> - <summary> - Finds and returns the distance between the current <see cref="T:StarSimLib.Physics.Body"/> instance and the given <see cref="T:StarSimLib.Physics.Body"/>. - In other words, it finds the magnitude of the translation vector between the two <see cref="T:StarSimLib.Physics.Body"/> instances. - </summary> - <param name="body">The other <see cref="T:StarSimLib.Physics.Body"/> instance to which to calculate the distance.</param> - <param name="displacement">The vector showing the displacement of the current body from the given one.</param> - <returns>The distance to the other <see cref="T:StarSimLib.Physics.Body"/> as a <see cref="T:System.Single"/>.</returns> - </member> - <member name="M:StarSimLib.Physics.Body.ResetForce"> - <summary> - Resets the internal force vector. - </summary> - </member> - <member name="M:StarSimLib.Physics.Body.Update(System.Double)"> - <summary> - Updates the <see cref="P:StarSimLib.Physics.Body.Position"/> of the current body using the internal force vector and the given time step. - </summary> - <param name="deltaTime">The time step.</param> - </member> - <member name="M:StarSimLib.Physics.Body.Update(StarSimLib.Data_Structures.Vector4d,System.Double)"> - <summary> - Updates the <see cref="P:StarSimLib.Physics.Body.Position"/> of the current body using the given force vector and time step. - </summary> - <param name="forceVector">The sum vector of all forces due to other <see cref="T:StarSimLib.Physics.Body"/>s.</param> - <param name="deltaTime">The time step.</param> - </member> - <member name="M:StarSimLib.Physics.Body.ToString"> - <inheritdoc /> - </member> <member name="T:StarSimLib.Physics.MassToColourDelegate"> <summary> - Takes the mass of a <see cref="T:StarSimLib.Physics.Body"/> instance and returns a colour for the <see cref="T:SFML.Graphics.CircleShape"/> - that will represent the <see cref="T:StarSimLib.Physics.Body"/> of the given mass. + Takes the mass of a <see cref="T:StarSimLib.Data_Structures.Body"/> instance and returns a colour for the <see cref="T:SFML.Graphics.CircleShape"/> + that will represent the <see cref="T:StarSimLib.Data_Structures.Body"/> of the given mass. </summary> - <returns>The colour of the <see cref="T:SFML.Graphics.CircleShape"/> for a <see cref="T:StarSimLib.Physics.Body"/> of the given mass.</returns> + <returns>The colour of the <see cref="T:SFML.Graphics.CircleShape"/> for a <see cref="T:StarSimLib.Data_Structures.Body"/> of the given mass.</returns> </member> <member name="T:StarSimLib.Physics.MassToRadiusDelegate"> <summary> - Takes the mass of a <see cref="T:StarSimLib.Physics.Body"/> instance and returns a radius for the <see cref="T:SFML.Graphics.CircleShape"/> - that will represent the <see cref="T:StarSimLib.Physics.Body"/> of the given mass. + Takes the mass of a <see cref="T:StarSimLib.Data_Structures.Body"/> instance and returns a radius for the <see cref="T:SFML.Graphics.CircleShape"/> + that will represent the <see cref="T:StarSimLib.Data_Structures.Body"/> of the given mass. </summary> - <returns>The radius of the <see cref="T:SFML.Graphics.CircleShape"/> for a <see cref="T:StarSimLib.Physics.Body"/> of the given mass.</returns> + <returns>The radius of the <see cref="T:SFML.Graphics.CircleShape"/> for a <see cref="T:StarSimLib.Data_Structures.Body"/> of the given mass.</returns> </member> <member name="T:StarSimLib.Physics.BodyGenerator"> <summary> - Provides methods for generating <see cref="T:StarSimLib.Physics.Body"/> instances. + Provides methods for generating <see cref="T:StarSimLib.Data_Structures.Body"/> instances. </summary> </member> <member name="F:StarSimLib.Physics.BodyGenerator.Rng"> @@ -948,67 +948,67 @@ </member> <member name="P:StarSimLib.Physics.BodyGenerator.CurrentGeneration"> <summary> - The current generation of <see cref="T:StarSimLib.Physics.Body"/> instances that the generator is on. + The current generation of <see cref="T:StarSimLib.Data_Structures.Body"/> instances that the generator is on. </summary> </member> <member name="M:StarSimLib.Physics.BodyGenerator.GenerateBodies(System.Int32,System.Boolean)"> <summary> - Generates an array of <see cref="T:StarSimLib.Physics.Body"/> instances, possibly including a central attractor. + Generates an array of <see cref="T:StarSimLib.Data_Structures.Body"/> instances, possibly including a central attractor. </summary> - <param name="bodyCount">The number of <see cref="T:StarSimLib.Physics.Body"/> instances to generate.</param> + <param name="bodyCount">The number of <see cref="T:StarSimLib.Data_Structures.Body"/> instances to generate.</param> <param name="centralAttractor">Whether to have a central massive attractor.</param> - <returns>The generated <see cref="T:StarSimLib.Physics.Body"/> array.</returns> + <returns>The generated <see cref="T:StarSimLib.Data_Structures.Body"/> array.</returns> </member> - <member name="M:StarSimLib.Physics.BodyGenerator.GenerateShapes(System.Collections.Generic.IEnumerable{StarSimLib.Physics.Body})"> + <member name="M:StarSimLib.Physics.BodyGenerator.GenerateShapes(System.Collections.Generic.IEnumerable{StarSimLib.Data_Structures.Body})"> <summary> - Generates a <see cref="T:System.Collections.Generic.Dictionary`2"/> mapping each given <see cref="T:StarSimLib.Physics.Body"/> to a + Generates a <see cref="T:System.Collections.Generic.Dictionary`2"/> mapping each given <see cref="T:StarSimLib.Data_Structures.Body"/> to a <see cref="T:SFML.Graphics.CircleShape"/> that represents the body instance in 2D space. </summary> - <param name="bodies">The <see cref="T:StarSimLib.Physics.Body"/> instances for which to generate the shapes.</param> + <param name="bodies">The <see cref="T:StarSimLib.Data_Structures.Body"/> instances for which to generate the shapes.</param> <returns> - A <see cref="T:System.Collections.Generic.Dictionary`2"/> mapping the given <see cref="T:StarSimLib.Physics.Body"/> instances to their <see cref="T:SFML.Graphics.CircleShape"/> instances. + A <see cref="T:System.Collections.Generic.Dictionary`2"/> mapping the given <see cref="T:StarSimLib.Data_Structures.Body"/> instances to their <see cref="T:SFML.Graphics.CircleShape"/> instances. </returns> </member> - <member name="M:StarSimLib.Physics.BodyGenerator.GenerateShapes(System.Collections.Generic.IEnumerable{StarSimLib.Physics.Body},StarSimLib.Physics.MassToRadiusDelegate,StarSimLib.Physics.MassToColourDelegate)"> + <member name="M:StarSimLib.Physics.BodyGenerator.GenerateShapes(System.Collections.Generic.IEnumerable{StarSimLib.Data_Structures.Body},StarSimLib.Physics.MassToRadiusDelegate,StarSimLib.Physics.MassToColourDelegate)"> <summary> - Generates a <see cref="T:System.Collections.Generic.Dictionary`2"/> mapping each given <see cref="T:StarSimLib.Physics.Body"/> to a + Generates a <see cref="T:System.Collections.Generic.Dictionary`2"/> mapping each given <see cref="T:StarSimLib.Data_Structures.Body"/> to a <see cref="T:SFML.Graphics.CircleShape"/> that represents the body instance in 2D space. </summary> - <param name="bodies">The <see cref="T:StarSimLib.Physics.Body"/> instances for which to generate the shapes.</param> + <param name="bodies">The <see cref="T:StarSimLib.Data_Structures.Body"/> instances for which to generate the shapes.</param> <param name="massToRadiusDelegate"> - The function to use to derive the radius of the <see cref="T:SFML.Graphics.CircleShape"/> that will represent a <see cref="T:StarSimLib.Physics.Body"/> + The function to use to derive the radius of the <see cref="T:SFML.Graphics.CircleShape"/> that will represent a <see cref="T:StarSimLib.Data_Structures.Body"/> instance from its mass. </param> <param name="massToColourDelegate"> - The function to use to derive the colour of the <see cref="T:SFML.Graphics.CircleShape"/> that will represent a <see cref="T:StarSimLib.Physics.Body"/> + The function to use to derive the colour of the <see cref="T:SFML.Graphics.CircleShape"/> that will represent a <see cref="T:StarSimLib.Data_Structures.Body"/> instance from its mass. </param> <returns> - A <see cref="T:System.Collections.Generic.Dictionary`2"/> mapping the given <see cref="T:StarSimLib.Physics.Body"/> instances to their <see cref="T:SFML.Graphics.CircleShape"/> instances. + A <see cref="T:System.Collections.Generic.Dictionary`2"/> mapping the given <see cref="T:StarSimLib.Data_Structures.Body"/> instances to their <see cref="T:SFML.Graphics.CircleShape"/> instances. </returns> </member> <member name="T:StarSimLib.Physics.UpdateDelegate"> <summary> - Updates the given <see cref="T:StarSimLib.Physics.Body"/> collections individual bodies, using the given delta time. + Updates the given <see cref="T:StarSimLib.Data_Structures.Body"/> collections individual bodies, using the given delta time. </summary> <param name="bodies">The body collection.</param> <param name="deltaTime">The time step.</param> </member> <member name="T:StarSimLib.Physics.BodyUpdater"> <summary> - Provides methods for updating <see cref="T:StarSimLib.Physics.Body"/> instance positions. + Provides methods for updating <see cref="T:StarSimLib.Data_Structures.Body"/> instance positions. </summary> </member> - <member name="M:StarSimLib.Physics.BodyUpdater.UpdateBodiesBruteForce(System.Collections.Generic.IEnumerable{StarSimLib.Physics.Body},System.Double)"> + <member name="M:StarSimLib.Physics.BodyUpdater.UpdateBodiesBruteForce(System.Collections.Generic.IEnumerable{StarSimLib.Data_Structures.Body},System.Double)"> <summary> - Updates the positions of all the given <see cref="T:StarSimLib.Physics.Body"/>s with O(n^2) time complexity, with the given time step. + Updates the positions of all the given <see cref="T:StarSimLib.Data_Structures.Body"/>s with O(n^2) time complexity, with the given time step. </summary> - <param name="bodies">The collection of <see cref="T:StarSimLib.Physics.Body"/>s whose positions to update.</param> + <param name="bodies">The collection of <see cref="T:StarSimLib.Data_Structures.Body"/>s whose positions to update.</param> <param name="deltaTime">The time step.</param> </member> <member name="T:StarSimLib.Physics.OrbitGenerator"> <summary> - Provides methods for initialising positions, velocities, and orbits for <see cref="T:StarSimLib.Physics.Body"/> instances. + Provides methods for initialising positions, velocities, and orbits for <see cref="T:StarSimLib.Data_Structures.Body"/> instances. </summary> </member> <member name="F:StarSimLib.Physics.OrbitGenerator.Rng"> @@ -1036,23 +1036,23 @@ </member> <member name="F:StarSimLib.UI.InputHandler.bodyDrawer"> <summary> - The renderer used to display the <see cref="T:StarSimLib.Physics.Body"/> instances on the screen. + The renderer used to display the <see cref="T:StarSimLib.Data_Structures.Body"/> instances on the screen. </summary> </member> <member name="F:StarSimLib.UI.InputHandler.managedBodies"> <summary> - Holds all the <see cref="T:StarSimLib.Physics.Body"/> instances that should be simulated. + Holds all the <see cref="T:StarSimLib.Data_Structures.Body"/> instances that should be simulated. </summary> </member> - <member name="M:StarSimLib.UI.InputHandler.#ctor(StarSimLib.Physics.Body[]@,StarSimLib.Graphics.Drawer@)"> + <member name="M:StarSimLib.UI.InputHandler.#ctor(StarSimLib.Data_Structures.Body[]@,StarSimLib.Graphics.Drawer@)"> <summary> Initialises a new instance of the <see cref="T:StarSimLib.UI.InputHandler"/> class. </summary> <param name="bodies"> - A reference to the <see cref="T:StarSimLib.Physics.Body"/> instances which should be managed by this instance. + A reference to the <see cref="T:StarSimLib.Data_Structures.Body"/> instances which should be managed by this instance. </param> <param name="drawer"> - A reference to the renderer used to display the <see cref="T:StarSimLib.Physics.Body"/> instances on the screen. + A reference to the renderer used to display the <see cref="T:StarSimLib.Data_Structures.Body"/> instances on the screen. </param> </member> <member name="P:StarSimLib.UI.InputHandler.IsSimulationPaused"> @@ -1062,7 +1062,7 @@ </member> <member name="P:StarSimLib.UI.InputHandler.RecordOrbitTracers"> <summary> - Whether to record previous <see cref="T:StarSimLib.Physics.Body"/> instance positions, in order to render an orbit tracer + Whether to record previous <see cref="T:StarSimLib.Data_Structures.Body"/> instance positions, in order to render an orbit tracer behind each body instance. </summary> </member>