Example #1
0
 private void RefineIfNeeded()
 {
     // Refine primitives in voxel if needed
     if (!_allCanIntersect)
     {
         for (var i = 0; i < _primitives.Count; ++i)
         {
             var prim = _primitives[i];
             // Refine primitive _prim_ if it's not intersectable
             if (!prim.CanIntersect)
             {
                 var p = prim.FullyRefine();
                 Debug.Assert(p.Count > 0);
                 if (p.Count == 1)
                 {
                     _primitives[i] = p[0];
                 }
                 else
                 {
                     _primitives[i] = new GridAccelerator(p, false);
                 }
             }
         }
         _allCanIntersect = true;
     }
 }
Example #2
0
 private void RefineIfNeeded()
 {
     // Refine primitives in voxel if needed
     if (!_allCanIntersect)
     {
         for (var i = 0; i < _primitives.Count; ++i)
         {
             var prim = _primitives[i];
             // Refine primitive _prim_ if it's not intersectable
             if (!prim.CanIntersect)
             {
                 var p = prim.FullyRefine();
                 Debug.Assert(p.Count > 0);
                 if (p.Count == 1)
                     _primitives[i] = p[0];
                 else
                     _primitives[i] = new GridAccelerator(p, false);
             }
         }
         _allCanIntersect = true;
     }
 }