Beispiel #1
0
 public Renderer(Game game)
 {
     this.game = game;
     camera    = game.Camera;
     data      = game.Data;
     stats     = new PerformanceWatch();
 }
Beispiel #2
0
        public void Show(MainWindow window, Game game, Star star)
        {
            base.Show(window);
            this.game = game;
            window.ChildNumber++;
            data        = game.Data;
            this.window = window;
            oldTime     = game.Running;
            game.Stop();
            game.Sim.WaitForIdle();

            editStar            = star;
            editStar.Editor     = this;
            textBoxName.Text    = star.Name;
            textBoxMass.Text    = "" + star.Mass;
            textBoxDensity.Text = "" + star.Density;

            updateComboBox();
            if (data.RefStar != null && editStar != data.RefStar)
            {
                comboBox1.SelectedIndex = 3;
            }
            else
            {
                comboBox1.SelectedIndex = 2;
            }

            readEnabled = true;
        }
Beispiel #3
0
 public void Show(MainWindow window, Game game)
 {
     base.Show(window);
     this.game = game;
     window.ChildNumber++;
     this.window     = window;
     this.simulation = game.Data;
     this.stars      = simulation.Stars;
     oldTime         = game.Running;
     game.Stop();
     game.Sim.WaitForIdle();
     SetStars(stars);
 }
Beispiel #4
0
        public Simulation(Camera camera, SimData data)
        {
            this.camera = camera;
            this.data   = data;

            GravitationalConstant = 0.001; //Math.Pow(6.674*10, -11);
            //Console.WriteLine(GravitationalConstant);

            TaskCount = Environment.ProcessorCount;
            Stats     = new PerformanceWatch();
            TaskStats = new PerformanceWatch[TaskCount];
            for (int i = 0; i < TaskCount; i++)
            {
                TaskStats[i] = new PerformanceWatch();
            }
        }
Beispiel #5
0
        public MainWindow()
        {
            InitializeComponent();
            MouseWheel += new MouseEventHandler(Window_MouseWheel);

            SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true);
            DoubleBuffered = true;

            game     = new Game();
            camera   = game.Camera;
            data     = game.Data;
            renderer = new Renderer(game);

            game.Start();

            TimerDraw.Start();
        }