Beispiel #1
0
        public static Options BeginsAtZeroOptions()
        {
            var options = new Options
            {
                Scales = new Scales()
            };

            var scales = new Scales
            {
                YAxes = new List <Scale>
                {
                    new CartesianScale
                    {
                        Ticks = new CartesianLinearTick
                        {
                            BeginAtZero = true
                        }
                    }
                }
            };

            options.Scales = scales;

            return(options);
        }
        public PatliteControl()
        {
            InitializeComponent();

            Scales.Add("rEnv", rScale);
            Scales.Add("yEnv", yScale);
            Scales.Add("gEnv", gScale);
        }
 internal override void Notify(MessageType msg, NamedElement element, object param)
 {
     base.Notify(msg, element, param);
     Scales.Notify(msg, element, param);
     Ranges.Notify(msg, element, param);
     Pointers.Notify(msg, element, param);
     Knobs.Notify(msg, element, param);
 }
 internal override void EndInit()
 {
     base.EndInit();
     Scales.EndInit();
     Ranges.EndInit();
     Pointers.EndInit();
     Knobs.EndInit();
 }
 protected override void OnDispose()
 {
     base.OnDispose();
     Scales.Dispose();
     Ranges.Dispose();
     Pointers.Dispose();
     Knobs.Dispose();
 }
 public static Scales IncreaseModulo(this Scales s)
 {
     if (s == Scales.Seven)
     {
         return(Scales.Four);
     }
     return(Increase(s));
 }
 internal override void BeginInit()
 {
     base.BeginInit();
     Scales.BeginInit();
     Ranges.BeginInit();
     Pointers.BeginInit();
     Knobs.BeginInit();
 }
Beispiel #8
0
 protected override void CreateNodes(ref Blocks.BlockBase root)
 {
     N          = "512"; Scale = Scales.Linear_Scale;
     InputNodes = new List <Blocks.BlockInputNode>()
     {
         new Blocks.BlockInputNode(ref root, "inputVector", "xt")
     };
 }
Beispiel #9
0
 public void MarkAsReadOnly()
 {
     ReadOnly = true;
     ChordiousSettings.MarkAsReadOnly();
     DiagramStyle.MarkAsReadOnly();
     Instruments.MarkAsReadOnly();
     ChordQualities.MarkAsReadOnly();
     Scales.MarkAsReadOnly();
 }
Beispiel #10
0
        public static void LoadScales()
        {
            TextAsset     textAsset  = Resources.Load("scales") as TextAsset;
            XmlSerializer serializer = new XmlSerializer(typeof(Scales));
            TextReader    reader     = new StringReader(textAsset.text);

            scales = serializer.Deserialize(reader) as Scales;
            reader.Close();
        }
Beispiel #11
0
        public void ConstructScaleFromString()
        {
            var scaleName = "Major";
            var scale     = Scales.ConstructScaleFromName(scaleName);

            Assert.IsNotNull(scale);
            Assert.IsTrue(scale.Steps.Count > 0);
            Assert.IsTrue(scale.Divisions > 0);
            Assert.AreEqual(scaleName, scale.Name);
        }
Beispiel #12
0
 public void SetScale(string name, Vector3 scale)
 {
     if (Scales.ContainsKey(name))
     {
         Scales[name] = scale;
     }
     else
     {
         Scales.Add(name, scale);
     }
 }
 IEnumerator CountdownForMessage(float time0)
 {
     for (float timer = time0; timer >= 0; timer -= Time.deltaTime)
     {
         Scales.Pause = true;
         Scales.ResetTimeScale();
         messageIsBeingDisplayed = true;
         yield return(null);
     }
     messageIsBeingDisplayed = false;
 }
Beispiel #14
0
  private ArrayList getBirthCountNumber(String number)
  {
      double    aux = double.Parse(number);
      ArrayList res = new ArrayList();

      if (aux < 10)
      {
          res.Add(Scales.getBirthNumbers()[int.Parse(aux.ToString())]);
      }
      return(res);
  }
        private void Initialize()
        {
            TextStrings.Add(0, "Нуль");
            TextStrings.Add(1, "Одна");
            TextStrings.Add(2, "Дві");
            TextStrings.Add(3, "Три");
            TextStrings.Add(4, "Чотири");
            TextStrings.Add(5, "П'ять");
            TextStrings.Add(6, "Шість");
            TextStrings.Add(7, "Сім");
            TextStrings.Add(8, "Вісім");
            TextStrings.Add(9, "Дев'ять");
            TextStrings.Add(10, "Десять");
            TextStrings.Add(11, "Одинадцять");
            TextStrings.Add(12, "Дванадцять");
            TextStrings.Add(13, "Тринадцять");
            TextStrings.Add(14, "Чотирнадцять");
            TextStrings.Add(15, "П'ятнадцять");
            TextStrings.Add(16, "Шістнадцять");
            TextStrings.Add(17, "Сімнадцять");
            TextStrings.Add(18, "Вісімнадцять");
            TextStrings.Add(19, "Дев'ятнадцять");
            TextStrings.Add(20, "Двадцять");
            TextStrings.Add(30, "Тридцять");
            TextStrings.Add(40, "Сорок");
            TextStrings.Add(50, "П'ятдесят");
            TextStrings.Add(60, "Шістдесят");
            TextStrings.Add(70, "Сімдесят");
            TextStrings.Add(80, "Вісімдесят");
            TextStrings.Add(90, "Дев'яносто");
            TextStrings.Add(100, "Сто");
            TextStrings.Add(200, "Двісті");
            TextStrings.Add(300, "Триста");
            TextStrings.Add(400, "Чотириста");
            TextStrings.Add(500, "П'ятсот");
            TextStrings.Add(600, "Шістсот");
            TextStrings.Add(700, "Сімсот");
            TextStrings.Add(800, "Вісімсот");
            TextStrings.Add(900, "Дев'ятсот");

            AdditionalStrings.Add(1, "Один");
            AdditionalStrings.Add(2, "Два");
            AdditionalStrings.Add(1000, "тисяча");
            AdditionalStrings.Add(1000000, "мільйон");
            AdditionalStrings.Add(1000000000, "мільярд");

            Scales.Add(1000000000, "мільярдів");
            Scales.Add(1000000, "мільйонів");
            Scales.Add(1000, "тисяч");

            AdditionalScales.Add(1000000000, "мільярди");
            AdditionalScales.Add(1000000, "мільйони");
            AdditionalScales.Add(1000, "тисячі");
        }
Beispiel #16
0
        public MidiControlViewModel(IEventAggregator ea, IRegionManager region, IUnityContainer container, MidiIn midiIn, MidiOut midiOut)
        {
            _ea = ea; _region = region; _container = container;

            //Inject midi + event subscriptions
            _mIn  = midiIn;
            _mOut = midiOut;
            _mIn.MessageReceived += _mIn_MessageReceived;
            _mIn.ErrorReceived   += _mIn_ErrorReceived;

            _scopedRegion = _region.CreateRegionManager();

            //Initialize midi and scale listings
            ScaleList       = new List <string>(Scales.GetScaleNames());
            MidiChannels    = Enumerable.Range(1, 16).ToList();
            KeyList         = Keys.GetKeyNames();
            SelectedChannel = MidiChannels.First();
            SelectedScale   = ScaleList.First();
            SelectedKey     = KeyList.First();

            UserInputMode = false;

            //Initialize Values
            LengthList = "500"; //500ms
            OctaveList = "0";   //Middle-Octave
            Repeat     = 1;     //Play Once

            //Init to Middle-C value to sliders
            SetNotes(NoteLogic.OctaveC[4], NoteLogic.OctaveC[4], NoteLogic.OctaveC[4], NoteLogic.OctaveC[4]);

            //Bind Commands to Methods
            StartInvProgressionCommand = new DelegateCommand(StartInversion);

            PlayMelody1 = new DelegateCommand(StartMelody1);
            PlayMelody2 = new DelegateCommand(StartMelody2);
            PlayMelody3 = new DelegateCommand(StartMelody3);
            PlayMelody4 = new DelegateCommand(StartMelody4);

            RollTheDiceCommand = new DelegateCommand(RollTheDice);

            //Strum begin
            Strum1BCommand = new DelegateCommand(Strum1B);
            Strum2BCommand = new DelegateCommand(Strum2B);
            Strum3BCommand = new DelegateCommand(Strum3B);
            Strum4BCommand = new DelegateCommand(Strum4B);
            //Strum end
            Strum1ECommand = new DelegateCommand(Strum1E);
            Strum2ECommand = new DelegateCommand(Strum2E);
            Strum3ECommand = new DelegateCommand(Strum3E);
            Strum4ECommand = new DelegateCommand(Strum4E);

            //CC Panel
            ConfigList = new ObservableCollection <string>(ControlChangeLogic.GetSynthConfigs());
        }
Beispiel #17
0
    public static Clip GetGuideClipFromScale(Scales scale, int root, decimal length)
    {
        Clip clip = new Clip(length, true);

        root &= 0x7F;

        foreach (var ix in GetIndexesFromScale(scale))
        {
            clip.Add(new NoteEvent(root + ix, 0, length, 127));
        }
        return(clip);
    }
        private void Initialize()
        {
            TextStrings.Add(0, "ноль");
            TextStrings.Add(1, "один");
            TextStrings.Add(2, "два");
            TextStrings.Add(3, "три");
            TextStrings.Add(4, "четыре");
            TextStrings.Add(5, "пять");
            TextStrings.Add(6, "шесть");
            TextStrings.Add(7, "семь");
            TextStrings.Add(8, "восемь");
            TextStrings.Add(9, "девять");
            TextStrings.Add(10, "десять");
            TextStrings.Add(11, "одиннадцать");
            TextStrings.Add(12, "двенадцать");
            TextStrings.Add(13, "тринадцать");
            TextStrings.Add(14, "четырнадцать");
            TextStrings.Add(15, "пятнадцать");
            TextStrings.Add(16, "шестнадцать");
            TextStrings.Add(17, "семнадцать");
            TextStrings.Add(18, "восемнадцать");
            TextStrings.Add(19, "девятнадцать");
            TextStrings.Add(20, "двадцать");
            TextStrings.Add(30, "тридцать");
            TextStrings.Add(40, "сорок");
            TextStrings.Add(50, "пятьдесят");
            TextStrings.Add(60, "шестьдесят");
            TextStrings.Add(70, "семьдесят");
            TextStrings.Add(80, "восемьдесят");
            TextStrings.Add(90, "девяносто");
            TextStrings.Add(100, "сто");
            TextStrings.Add(200, "двести");
            TextStrings.Add(300, "триста");
            TextStrings.Add(400, "четыреста");
            TextStrings.Add(500, "пятьсот");
            TextStrings.Add(600, "шестьсот");
            TextStrings.Add(700, "семьсот");
            TextStrings.Add(800, "восемьсот");
            TextStrings.Add(900, "девятьсот");

            AdditionalStrings.Add(1, "одна");
            AdditionalStrings.Add(2, "две");
            AdditionalStrings.Add(1000, "тысяча");
            AdditionalStrings.Add(2000, "тысячи");
            AdditionalStrings.Add(1000000, "миллион");
            AdditionalStrings.Add(2000000, "миллиона");
            AdditionalStrings.Add(1000000000, "миллиард");
            AdditionalStrings.Add(2000000000, "миллиарда");

            Scales.Add(1000000000, "миллиардов");
            Scales.Add(1000000, "миллионов");
            Scales.Add(1000, "тысяч");
        }
Beispiel #19
0
        private static Chart GenerateLineScatterChart()
        {
            Chart chart = new Chart();

            chart.Type = Enums.ChartType.Line;

            Data data = new Data();

            data.Labels = new List <string>()
            {
                "January", "February", "March", "April", "May", "June", "July"
            };



            data.Datasets = new List <Dataset>();


            Options options = new Options()
            {
                Scales = new Scales()
            };

            Scales scales = new Scales()
            {
                YAxes = new List <Scale>()
                {
                    new CartesianScale()
                }
            };

            CartesianScale yAxes = new CartesianScale()
            {
                Ticks = new Tick()
            };

            Tick tick = new Tick()
            {
                Callback = "function(value, index, values) {return '$' + value;}"
            };

            yAxes.Ticks  = tick;
            scales.YAxes = new List <Scale>()
            {
                yAxes
            };
            options.Scales = scales;
            chart.Options  = options;

            chart.Data = data;

            return(chart);
        }
Beispiel #20
0
        public IScaleDescriptorAssignment AddDynamicScaleForProperty(string name)
        {
            var scaleAssignment = this.Scales.ForProperty(name);

            if (null == scaleAssignment)
            {
                var scale = new DynamicPropertyScaleDescriptor(this, name);
                scaleAssignment = new ScaleDescriptorAssignment {
                    PropertyName = name, Scale = scale
                };
                Scales.Add(scaleAssignment);
            }
            return(scaleAssignment);
        }
Beispiel #21
0
        private void AddBar(Genome genome, string ksa, Octave[] octaves, DurationCFugue durCF, byte[] barIter, string tempo)
        {
            if (barCount == 0)
            {
                keySignature = ksa;
                Clefs[0]     = Scales.GetClef(octaves[0]);
                Clefs[1]     = Scales.GetClef(octaves[1]);
                Tempo        = "";
                geneticSong  = new GeneticSong(keySignature);
            }

            if (keySignature == ksa)
            {
                byte[] oct         = { (byte)octaves[0], (byte)octaves[1] };
                int    barPosition = GetBarPosition();
                geneticSong.AddGenome(tempo, genome, oct, durCF, barIter, barPosition);

                if (pause == true)
                {
                    addBarOnPause = true;
                }

                // If the new bar is the first one in the next row.
                if (barCount % individPerRow == 0)
                {
                    StartNewRow(ksa);
                }

                ScoreStaffs ss = CreateScoreStaffsBar(genome, tempo, barPosition);

                if (addEmptyBar == false)
                {
                    scores.Add(ss);
                    scoreWrapPanel.Children.Add(ss);
                }
                else
                {
                    AddBlankBar(ss, barPosition);
                }

                barCount++;
                addEmptyBar = false;
                Tempo       = tempo;
            }
            else
            {
                MessageBox.Show("Key signatures must match!", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning);
            }
        }
        public void GetFrequence_Success()
        {
            Pitches[] pitchArray = new Pitches[] {
                Pitches.C,
                Pitches.Csharp,
                Pitches.D,
                Pitches.Dsharp,
                Pitches.E,
                Pitches.F,
                Pitches.Fsharp,
                Pitches.G,
                Pitches.Gsharp,
                Pitches.A,
                Pitches.Asharp,
                Pitches.B
            };

            Scales[] scaleArray = new Scales[] {
                Scales.Four,
                Scales.Five,
                Scales.Six,
                Scales.Seven
            };

            List <double> frequences        = new List <double>();
            double?       previousFrequence = null;

            foreach (var scale in scaleArray)
            {
                foreach (var pitch in pitchArray)
                {
                    var frequence = frequenceRepository[pitch, scale];
                    Assert.IsNotNull(frequence);

                    if (previousFrequence.HasValue)
                    {
                        Assert.IsTrue(previousFrequence < frequence);
                    }

                    previousFrequence = frequence;

                    Assert.IsFalse(frequences.Contains(frequence));

                    frequences.Add(frequence);
                }
            }

            Assert.AreEqual(scaleArray.Length * pitchArray.Length, frequences.Count);
        }
Beispiel #23
0
        /// <summary>
        /// Updates the parts[] vector based on the current rhythm gene being a note.
        /// </summary>
        /// <param name="i"></param>
        /// <param name="rhythmGene"></param>
        /// <param name="pitchSoloPart0"></param>
        /// <param name="pitchSoloPart1"></param>
        /// <param name="velocitySoloPart0"></param>
        /// <param name="velocitySoloPart1"></param>
        /// <param name="rhythmSoloPart0"></param>
        private void ProcessPitchGene(ref int i, char rhythmGene)
        {
            byte note1, note2;
            byte velocity1, velocity2;
            byte addDur = 1, fP;
            int  j;
            byte genotypeIterate_0 = Parameters.genotypeIterate[0];
            byte maxIterate        = Parameters.maxIterate;
            byte keySignatureIndex = Parameters.keySignatureIndex;

            byte[] octaves  = Parameters.octavesByteValues;
            string duration = Durations.FinalDuration(Parameters.durationIndex, addDur);

            int[]    pitchSoloPart0    = currentPitchChromosome[0];
            int[]    pitchSoloPart1    = currentPitchChromosome[1];
            byte[]   velocitySoloPart0 = currentVelocityChromosome[0];
            byte[]   velocitySoloPart1 = currentVelocityChromosome[1];
            string[] rhythmSoloPart0   = currentRhythmChromosome[0];

            do
            {
                fP        = Scales.FirstPitch(octaves[0], keySignatureIndex);
                note1     = PitchSolo1Decode(pitchSoloPart0[i], fP);
                velocity1 = VelocityDecode(velocitySoloPart0[i]);
                parts[0] += "[" + note1.ToString() + "]" + duration + "V" + velocity1.ToString() + " ";
                j         = note1 - fP;
                parts[2] += ActualOctave(j, 0).ToString() +  //(byte)Parameters.octaves[0] +
                            "|" + Scales.scales[keySignatureIndex][j] + "|" + addDur + " ";

                fP        = Scales.FirstPitch(octaves[1], keySignatureIndex);
                note2     = PitchSolo2Decode(pitchSoloPart1[i], note1, fP);
                velocity2 = VelocityDecode(velocitySoloPart1[i]);
                parts[1] += "[" + note2.ToString() + "]" + duration + "V" + velocity2.ToString() + " ";
                j         = note2 - fP;
                parts[3] += ActualOctave(j, 1).ToString() +  //(byte)Parameters.octaves[0] +
                            "|" + Scales.scales[keySignatureIndex][j] + "|" + addDur + " ";

                i++;

                if (i == maxIterate || i % genotypeIterate_0 == 0)
                {
                    break;
                }
                else
                {
                    rhythmGene = RhythmDecode(rhythmSoloPart0[i]);
                }
            }while (rhythmGene == 'p');
        }
Beispiel #24
0
        private void InitCanvasForm()
        {
            SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            SetStyle(ControlStyles.UserPaint, true);
            this.BackgroundImageLayout = ImageLayout.None;

            //picBox.Dock = DockStyle.Fill;
            //SKBitmap bg = oSkBackgPool.GetBackGroundFromPool();
            //oBMPPool = new BitmapPool(bg.Width, bg.Height, 20);
            //Bitmap bmp = oBMPPool.GetObject();
            //Image bg = oBackgPool.GetBackGroundFromPool();
            //this.BackgroundImage = ConvertToBitmap(bg, bmp);

            Screen[] screens = Screen.AllScreens;
            if (screens.Length > 1)
            {
                this.Location    = screens[1].WorkingArea.Location;
                this.WindowState = FormWindowState.Maximized;
            }
            else
            {
                this.Location = screens[0].WorkingArea.Location;
                this.Size     = new Size(SettingsHolder.Instance.WindowWidth, SettingsHolder.Instance.WindowHeight);
            }
            Scales.SetScale(this.Size);

            this.FormBorderStyle = FormBorderStyle.None;

            Bitmap oBMP         = (Bitmap)oBackgPool.GetBackGroundFromPool(); //Get background bitmap
            Bitmap bmpConverted = new Bitmap(oBMP.Width, oBMP.Height, PixelFormat.Format32bppPArgb);

            using (Graphics gr = Graphics.FromImage(bmpConverted)) {
                gr.DrawImage(oBMP, new Rectangle(0, 0, bmpConverted.Width, bmpConverted.Height));
                gr.ScaleTransform((float)this.Size.Width / oBMP.Width, (float)this.Size.Height / oBMP.Height);
            }

            Process.GetCurrentProcess().PriorityClass = ProcessPriorityClass.RealTime;

            //CopyBitmaps(oBMP, bmpConverted);
            oBMP = bmpConverted;
            this.BackgroundImage = oBMP;

            Bitmap led = new Bitmap(ledImage.Width, ledImage.Height, PixelFormat.Format32bppPArgb);

            CopyBitmaps(ledImage, led);
            ledImage = led;
        }
Beispiel #25
0
 private void scale2Item_Click(object sender, EventArgs e)
 {
     if (WeighPage2 == null)
     {
         return;
     }
     if (!IsInTab(scale2Item.Text))
     {
         Scale2          = new Scales();
         Scale2.TopLevel = false;
         Scale2.Parent   = this.WeighPage2;
         Scale2.Show();
         MainTab.TabPages.Add(WeighPage2);
     }
     MainTab.SelectedTab = WeighPage2;
 }
        private void Initialize()
        {
            TextStrings.Add(0, "cero");
            TextStrings.Add(1, "uno");
            TextStrings.Add(2, "dos");
            TextStrings.Add(3, "tres");
            TextStrings.Add(4, "cuatro");
            TextStrings.Add(5, "cinco");
            TextStrings.Add(6, "seis");
            TextStrings.Add(7, "siete");
            TextStrings.Add(8, "ocho");
            TextStrings.Add(9, "nueve");
            TextStrings.Add(10, "diez");
            TextStrings.Add(11, "once");
            TextStrings.Add(12, "doce");
            TextStrings.Add(13, "trece");
            TextStrings.Add(14, "catorce");
            TextStrings.Add(15, "quince");
            TextStrings.Add(16, "dieciséis");
            TextStrings.Add(17, "diecisiete");
            TextStrings.Add(18, "dieciocho");
            TextStrings.Add(19, "diecinueve");
            TextStrings.Add(20, "veinte");
            TextStrings.Add(30, "treinta");
            TextStrings.Add(40, "cuarenta");
            TextStrings.Add(50, "cincuenta");
            TextStrings.Add(60, "sesenta");
            TextStrings.Add(70, "setenta");
            TextStrings.Add(80, "ochenta");
            TextStrings.Add(90, "noventa");
            TextStrings.Add(100, "cien");
            TextStrings.Add(200, "doscientos");
            TextStrings.Add(300, "trescientos");
            TextStrings.Add(400, "cuatrocientos");
            TextStrings.Add(500, "quinientos");
            TextStrings.Add(600, "seiscientos");
            TextStrings.Add(700, "setecientos");
            TextStrings.Add(800, "ochocientos");
            TextStrings.Add(900, "novecientos");

            AdditionalStrings.Add(1, "un");
            AdditionalStrings.Add(1000000, "milones");

            Scales.Add(1000000000, "mil millones");
            Scales.Add(1000000, "millón");
            Scales.Add(1000, "mil");
        }
        protected void ExtendScale(Scale scale, byte interval)
        {
            Scale extendedScale = scale.Duplicate();

            extendedScale.Extend(interval);
            if (!extendedScale.IsDone)
            {
                CreateScale(extendedScale);
            }
            else if (extendedScale.IsValid)
            {
                if (ValidateMinMax(extendedScale))
                {
                    Scales.Add(extendedScale);
                }
            }
        }
Beispiel #28
0
 public static bool isInScale(int value, Scales scale)
 {
     foreach (Notes note in Enum.GetValues(typeof(Notes)))
     {
         if ((int)note == value)
         {
             foreach (String inScale in getScale(scale))
             {
                 if (note.ToString().StartsWith(inScale))
                 {
                     return(true);
                 }
             }
         }
     }
     return(false);
 }
Beispiel #29
0
        private void lstScaleChanger_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            string scaleString = ((ListBoxItem)lstScaleChanger.SelectedItem).Content.ToString();
            Scales scale       = (Scales)Enum.Parse(typeof(Scales), scaleString);
            Color  color       = Colors.Green;

            if (scaleString.EndsWith("maj"))
            {
                color = Colors.Red;
            }
            else if (scaleString.EndsWith("min"))
            {
                color = Colors.Blue;
            }

            GraphicsChest.getChest().NetytarDrawer.drawLines(scale, color);
            GraphicsChest.getChest().NetytarDrawer.drawEllipses(scale);
        }
Beispiel #30
0
    private ArrayList getMultiplicativeNumber(String number)
    {
        double    aux = double.Parse(number);
        ArrayList res = new ArrayList();
        String    numberTranslated = cardinal.getCardinalNumber(number)[0].ToString();

        if (aux == 1)
        {
            numberTranslated += "e";
        }
        numberTranslated += " fois";

        res.Add(numberTranslated);
        if (aux < 10)
        {
            res.Add(Scales.getMultiplicativeNumbers()[int.Parse(aux.ToString())]);
        }
        return(res);
    }
	public static void AdaptiveLeapfrog (ref Vector2 pos2, ref Vector2 vel2, float t1, float nualf, Collider[] cols, ref Scales.GravityLevel gravityLevel)
	{
		int steps = 0, stepsLimit = 1;

		while (true) {
			pos2 += vel2 * t1 * 0.5f; 

			Vector2 force2 = Gravity (pos2, cols);
			float r = pos2.magnitude;
			float fr = force2.magnitude;

			if (fr > (gravityThreshold + 1) * (gravityThreshold + 1))
				gravityLevel = Scales.GravityLevel.high;
			else if (fr > gravityThreshold * gravityThreshold)
				gravityLevel = Scales.GravityLevel.medium;
			else 
				gravityLevel = Scales.GravityLevel.normal;

			float t0 = nualf / Mathf.Sqrt (fr / r);

			if (t1 < t0) {
				vel2 += force2 * t1;  			
				pos2 += vel2 * t1 * 0.5f;   	

				if (++steps == stepsLimit)
					break;

				while (( steps % 2 ) != 0) {
					steps /= 2;
					stepsLimit /= 2;        
					t1 *= 2.0f;
				}    
			} else {
				pos2 -= vel2 * t1 * 0.5f;  	
				
				t1 *= 0.5f; 
				steps *= 2;
				stepsLimit *= 2;
			}
		}
	}
Beispiel #32
0
 void Awake()
 {
     Instance = this;
 }
Beispiel #33
0
 public void ChangeOperScale(Scales op)
 {
     tabControlViewScales.SelectedIndex = (int)op;
 }