Ejemplo n.º 1
0
 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);
 }
Ejemplo n.º 2
0
 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;
     }
 }
Ejemplo n.º 3
0
 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;
     }
 }
Ejemplo n.º 4
0
 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;
     }
 }