예제 #1
0
        private void btnResetTotal_Click(object sender, EventArgs e)
        {
            chkCoupledXPos.Checked = false;
            chkCoupledYPos.Checked = false;

            _rigidBody = new RigidBody(new MyVector(0, 0, 0), new DoubleVector(1, 0, 0, 0, 1, 0), 1, _boundryLower, _boundryUpper);

            // Set up PointMasses
            _north = _rigidBody.AddPointMass(0, 0, 0, MINMASS);
            _south = _rigidBody.AddPointMass(0, 0, 0, MINMASS);
            _east = _rigidBody.AddPointMass(0, 0, 0, MINMASS);
            _west = _rigidBody.AddPointMass(0, 0, 0, MINMASS);

            trkNorthPos.Value = 500;
            trkNorthPos_Scroll(this, new EventArgs());
            trkSouthPos.Value = 500;
            trkSouthPos_Scroll(this, new EventArgs());
            trkEastPos.Value = 500;
            trkEastPos_Scroll(this, new EventArgs());
            trkWestPos.Value = 500;
            trkWestPos_Scroll(this, new EventArgs());

            trkNorthMass.Value = 500;
            trkNorthMass_Scroll(this, new EventArgs());
            trkSouthMass.Value = 500;
            trkSouthMass_Scroll(this, new EventArgs());
            trkEastMass.Value = 500;
            trkEastMass_Scroll(this, new EventArgs());
            trkWestMass.Value = 500;
            trkWestMass_Scroll(this, new EventArgs());

            // Set the momentum
            trkAngularMomentum.Value = 500;
            trkAngularMomentum_Scroll(this, new EventArgs());
        }
예제 #2
0
        public void AddRangePointMasses(PointMass[] masses)
        {
            // Hook to these mass's change events
            for (int massCntr = 0; massCntr < masses.Length; massCntr++)
            {
                masses[massCntr].PropertyChanged += new EventHandler(PointMassChanged);
            }

            // Add them to my list
            _masses.AddRange(masses);

            // Tell myself to adjust for the added weight
            ResetInertiaTensorAndCenterOfMass();
        }
예제 #3
0
        public PointMass AddPointMass(double x, double y, double z, double mass)
        {
            // Make a new one
            PointMass retVal = new PointMass(x, y, z, mass);

            // Get set up to listen to its change event
            retVal.PropertyChanged += new EventHandler(PointMassChanged);

            // Add this to my list
            _masses.Add(retVal);

            // Tell myself to adjust for the added weight
            ResetInertiaTensorAndCenterOfMass();

            // Exit Function
            return retVal;
        }
예제 #4
0
        private void btnResetPartial_Click(object sender, EventArgs e)
        {
            _rigidBody = new RigidBody(new MyVector(0, 0, 0), new DoubleVector(1, 0, 0, 0, 1, 0), 1, _boundryLower, _boundryUpper);

            // Set up PointMasses
            _north = _rigidBody.AddPointMass(0, 0, 0, MINMASS);
            _south = _rigidBody.AddPointMass(0, 0, 0, MINMASS);
            _east = _rigidBody.AddPointMass(0, 0, 0, MINMASS);
            _west = _rigidBody.AddPointMass(0, 0, 0, MINMASS);

            trkNorthPos_Scroll(this, new EventArgs());
            trkSouthPos_Scroll(this, new EventArgs());
            trkEastPos_Scroll(this, new EventArgs());
            trkWestPos_Scroll(this, new EventArgs());

            trkNorthMass_Scroll(this, new EventArgs());
            trkSouthMass_Scroll(this, new EventArgs());
            trkEastMass_Scroll(this, new EventArgs());
            trkWestMass_Scroll(this, new EventArgs());

            // Set the momentum
            trkAngularMomentum_Scroll(this, new EventArgs());
        }