Пример #1
0
/*!
SLGroup::intersect loops over all child nodes of the group and calls their
intersect method.  
*/
SLbool SLGroup::shapeHit(SLRay* ray)
{  assert(ray != 0);

   SLNode* current = _first;
   SLbool wasHit = false;
   while (current)
   {  
      // do not test origin node for shadow rays 
      if (!(current==ray->originShape && ray->type==SHADOW))
      {  if (current->hit(ray) && !wasHit) wasHit = true;
      }
      
      if (ray->isShaded()) return true;
      current = current->next();
   }
   return wasHit;
}