public MechanicEnergy()
        {
            InitializeComponent();
            physicalObject = new Object(Resources.Ball, Material.Gold, this.Width / 2, this.Height / 2, new Rectangle(0, 0, this.Width, 625))
            {
                Material = Material.Iron,
                Mass = (float)numericUpDownMass.Value,
                Speed = new Vector((float)numericUpDownSpeed.Value, 0)
            };
            physicalObject.X = this.Width / 2;
            physicalObject.Y = 625;
            comboBox1.SelectedIndex = 0;

            energyChart = new EnergyChart();

            this.MouseMove += MechanicEnergy_MouseMove;
            this.MouseWheel += MechanicEnergy_MouseWheel;
            this.MouseUp += MechanicEnergy_MouseUp;
            this.MouseDown += MechanicEnergy_MouseDown;

            forcePen = new Pen(Color.Black);
            forcePen.StartCap = LineCap.Round;
            forcePen.EndCap = LineCap.ArrowAnchor;

            timer.Start();
        }
Beispiel #2
0
        /// <summary>
        /// Инициализира формата, физичния обект и евентите
        /// </summary>
        public MechanicEnergy()
        {
            InitializeComponent();

            physicalObject = new Object(Resources.Ball, Material.Gold, this.Width / 2, this.Height / 2, new Rectangle(0, 0, this.Width, 625))
            {
                Mass       = 10,
                Speed      = new Vector(0, 0),
                UseGravity = true
            };
            physicalObject.X = this.Width / 2;
            physicalObject.Y = 625;

            energyChart = new EnergyChart();

            this.MouseMove  += MechanicEnergy_MouseMove;
            this.MouseWheel += MechanicEnergy_MouseWheel;
            this.MouseUp    += MechanicEnergy_MouseUp;
            this.MouseDown  += MechanicEnergy_MouseDown;

            forcePen          = new Pen(Color.Black);
            forcePen.StartCap = LineCap.Round;
            forcePen.EndCap   = LineCap.ArrowAnchor;

            propertiesForm = new ObjectProperties(physicalObject);

            timer.Start();
        }
Beispiel #3
0
        public MechanicEnergy()
        {
            InitializeComponent();
            physicalObject = new Object(Resources.Ball, Material.Gold, this.Width / 2, this.Height / 2, new Rectangle(0, 0, this.Width, 625))
            {
                Material = Material.Iron,
                Mass     = (float)numericUpDownMass.Value,
                Speed    = new Vector((float)numericUpDownSpeed.Value, 0)
            };
            physicalObject.X        = this.Width / 2;
            physicalObject.Y        = 625;
            comboBox1.SelectedIndex = 0;

            energyChart = new EnergyChart();

            this.MouseMove  += MechanicEnergy_MouseMove;
            this.MouseWheel += MechanicEnergy_MouseWheel;
            this.MouseUp    += MechanicEnergy_MouseUp;
            this.MouseDown  += MechanicEnergy_MouseDown;

            forcePen          = new Pen(Color.Black);
            forcePen.StartCap = LineCap.Round;
            forcePen.EndCap   = LineCap.ArrowAnchor;

            timer.Start();
        }