Esempio n. 1
0
 /// <summary>
 /// Изменяет амплитуду после отражения
 /// </summary>
 /// <param name="FM1"></param>
 /// <param name="FM2"></param>
 /// <returns></returns>
 public static Modifier Refl(Modifier M1, Modifier M2)
 {
     if (M1.AmpMod.Length != M2.AmpMod.Length)
         return null;
     Modifier result = new Modifier(null, M1.soundSpeed);
     FrequencyMod[] FM  = new FrequencyMod[M1.AmpMod.Length];
     for (int i = 0; i < M1.AmpMod.Length; i++)
     {
         FM[i] = new FrequencyMod((1 - M1.AmpMod[i].Amplitude) * M2.AmpMod[i].Amplitude,M1.AmpMod[i].Freq);
     }
     result.AmpMod = FM;
     result.delay = M2.delay;
     return result;
 }
Esempio n. 2
0
        public Wave(Vector waveVect, float prevDist, Modifier FM)
        {
            if (waveMod == null)
                waveMod = FM;
            else
                for (int i = 0; i < FM.AmpMod.Length; i++)
                    waveMod.AmpMod[i].Amplitude = waveMod.AmpMod[i].Amplitude * FM.AmpMod[i].Amplitude;

                    direct = waveVect;
            previousDist = previousDist + prevDist;
            end = new Point();
            speed = 331.2F;
        }
Esempio n. 3
0
 public Polygon(List<Point> ListOfTops, Modifier md)
 {
     Tops = new List<Point>(ListOfTops);
     mods = md;
 }
Esempio n. 4
0
        public Wave(Vector waveVect)
        {
            direct = waveVect;
            previousDist = 0;
            end = new Point();
            speed = 331.2F;
            FrequencyMod[] t = { new FrequencyMod(1f, 128),
                             new FrequencyMod(1f, 256),
                             new FrequencyMod(1f, 512),
                             new FrequencyMod(1f, 1024),
                             new FrequencyMod(1f, 2048),
                             new FrequencyMod(1f, 4096),
                             new FrequencyMod(1f, 10000),
                               };

            waveMod = new Modifier(0, t);
        }
Esempio n. 5
0
 public void AddModifier(Modifier mod)
 {
     modifiers.Add(mod);
 }