Example #1
0
        private void GenerateSystem()
        {
            foreach (MiniPlanet miniPlanet in planets)
            {
                if (miniPlanet != null)
                {
                    miniPlanet.DestroyGeometry();
                }
            }

            planets.Clear();



            earth = new MiniPlanet(new Vector3(200, 0, 0), 50,
                                   NoiseGenerator.ParameterisedFastPlanet(50, NoiseGenerator.miniPlanetParameters, RandomHelper.GetRandomInt(1000)), 101, 1,
                                   Color.DarkOrange, Color.PaleGreen, true, 0.97f, 1.05f, 10, 4);

            earth.SetOrbit(Vector3.Zero, Vector3.Up, 0.0001f);
            earth.SetRotation(Vector3.Up, 0.001f);
            planets.Add(earth);

            MiniPlanet moon = new MiniPlanet(new Vector3(600, 0, 0), 20,
                                             NoiseGenerator.RidgedMultiFractal(0.01f), 41, 1,
                                             Color.DarkGray, Color.DarkGray);

            moon.SetOrbit(earth, Vector3.Up, 0.001f);
            planets.Add(moon);
        }
Example #2
0
 public void SetOrbit(MiniPlanet bodyToOrbit, Vector3 axis, float speed)
 {
     CurrentOrbit = new Orbit()
     {
         Axis = axis, BodyToOrbit = bodyToOrbit, Speed = speed
     };
     bodyToOrbit.AddChildBody(this);
 }
Example #3
0
 public void AddChildBody(MiniPlanet miniPlanet)
 {
     childPlanets.Add(miniPlanet);
 }