/// <summary>
 /// Adds the direct sound to the collection of histograms.
 /// </summary>
 /// <param name="D">a completed direct sound simulation</param>
 /// <param name="S">the source object</param>
 public void AddDirect(Direct_Sound D, Source S)
 {
     for (int i = 0; i < Rec_List.Length; i++)
     {
         Vector dir = S.H_Origin() - Rec_List[i].H_Origin;
         dir.Normalize();
         for (int oct = 0; oct < 8; oct++)
         {
             int tsample = 0;
             int length = D.Io[i][oct].Length;
             for (int s = 0; s < length; s++)
             {
                 if (D.EnergyValue(oct, s, i) > 0 && tsample == 0) tsample = s;
                 if (s < Rec_List[i].Recs.SampleCT && D.Validity[i]) Rec_List[i].Combine_Sample(s - tsample, D.EnergyValue(oct, s, i), dir, dir, oct);
             }
         }
     }
 }