Esempio n. 1
0
        private void CreateFields()
        {
            _gravityField = new GravityFieldSpace(_map);

            // These two can't deviate too far from each other.  Too much gravity with no swirl will just make a big blob.  Too much swirl with no gravity
            // isn't as bad, but more gravity makes it more interesting
            double gravitationalConstant = UtilityCore.GetScaledValue(.0001d, .0005d, 0d, 1d, StaticRandom.NextDouble());
            double swirlStrength         = UtilityCore.GetScaledValue(50d, 600d, 0d, 1d, StaticRandom.NextDouble());

            double percent = UtilityCore.GetScaledValue(.1d, 1.5d, 0d, 1d, StaticRandom.NextDouble());

            gravitationalConstant *= percent;
            swirlStrength         *= percent;

            _gravityField.GravitationalConstant = gravitationalConstant;

            _gravityField.Swirl   = new GravityFieldSpace.SwirlField(swirlStrength, new Vector3D(0, 0, 1), 10d);
            _gravityField.Boundry = new GravityFieldSpace.BoundryField(.85d, 5000d, 2d, _boundryMin, _boundryMax);
        }
        private void CreateFields()
        {
            _gravityField = new GravityFieldSpace(_map);

            // These two can't deviate too far from each other.  Too much gravity with no swirl will just make a big blob.  Too much swirl with no gravity
            // isn't as bad, but more gravity makes it more interesting
            double gravitationalConstant = UtilityCore.GetScaledValue(.0001d, .0005d, 0d, 1d, StaticRandom.NextDouble());
            double swirlStrength = UtilityCore.GetScaledValue(50d, 600d, 0d, 1d, StaticRandom.NextDouble());

            double percent = UtilityCore.GetScaledValue(.1d, 1.5d, 0d, 1d, StaticRandom.NextDouble());

            gravitationalConstant *= percent;
            swirlStrength *= percent;

            _gravityField.GravitationalConstant = gravitationalConstant;

            _gravityField.Swirl = new GravityFieldSpace.SwirlField(swirlStrength, new Vector3D(0, 0, 1), 10d);
            _gravityField.Boundry = new GravityFieldSpace.BoundryField(.85d, 5000d, 2d, _boundryMin, _boundryMax);
        }