public PlanetarySystem(string[] sourceData, string outFile) { curPlanets = new PlanetaryBody[sourceData.Length]; for (int intI = 0; intI < sourceData.Length; intI++) { PlanetaryBody pb = new PlanetaryBody(); pb.position = new Vector3(sourceData[intI]); pb.name = "" + intI; curPlanets[intI] = pb; } sw = new StreamWriter(outFile); }
void UpdateZVel(PlanetaryBody p1, PlanetaryBody p2) { if (p1.position.z < p2.position.z) { p1.velocity.z += 1; p2.velocity.z -= 1; } if (p1.position.z > p2.position.z) { p1.velocity.z -= 1; p2.velocity.z += 1; } }
void UpdateYVel(PlanetaryBody p1, PlanetaryBody p2) { if (p1.position.y < p2.position.y) { p1.velocity.y += 1; p2.velocity.y -= 1; } if (p1.position.y > p2.position.y) { p1.velocity.y -= 1; p2.velocity.y += 1; } }
void UpdateXVel(PlanetaryBody p1, PlanetaryBody p2) { if (p1.position.x < p2.position.x) { p1.velocity.x += 1; p2.velocity.x -= 1; } if (p1.position.x > p2.position.x) { p1.velocity.x -= 1; p2.velocity.x += 1; } }