예제 #1
0
        public void AddHitPoint(PPMHitPoint hp)
        {
            if (this.hitPoints.Count <= MaxHitPoints)
            {
                this.hitPoints.Add(hp);
#if VERBOSE
                if (hitPoints.Count % 1000 == 0)
                    Tracer.TraceLine("HitPoints -Collected {0} / Needed {1}", hitPoints.Count, MaxHitPoints);
#endif
            }
            else
            {
                if (Grid == null)
                {
                    lock (build_lock)
                    {
                        Tracer.TraceLine("Start building photons hashgrid");
                        Grid = new HashGrid(hitPoints, Width, Height);
                        Grid.ReHash();
                        Tracer.TraceLine("Complete!");
                    }
                }
            }

        }
예제 #2
0
 internal void BuildGrid()
 {
     if (Grid == null)
     {
         lock (build_lock)
         {
             Tracer.TraceLine("Start building photons hashgrid");
             Grid = new HashGrid(hitPoints, Width, Height);
             Tracer.TraceLine("Complete!");
         }
     }
 }
예제 #3
0
 public void ResetContext()
 {
     lock (build_lock)
     {
         hitPoints.Clear();
         TotalPhotons += (ulong)photons;
         photons = 0;
         Grid = null;
     }
 }