Пример #1
0
bool BicubicPatch::All_Intersections(const Ray& ray, IStack& Depth_Stack, TraceThreadData *Thread)
{
    int Found, cnt = 0;

    Found = false;

    Thread->Stats()[Ray_Bicubic_Tests]++;

    switch (Patch_Type)
    {
        case 0:

            cnt = intersect_bicubic_patch0(ray, Depth_Stack, Thread);

            break;

        case 1:

            cnt = bezier_tree_walker(ray, Node_Tree, Depth_Stack, Thread);

            break;

        default:

            throw POV_EXCEPTION_STRING("Bad patch type in All_Bicubic_Patch_Intersections.");
    }

    if (cnt > 0)
    {
        Thread->Stats()[Ray_Bicubic_Tests_Succeeded]++;

        Found = true;
    }

    return (Found);
}
Пример #2
0
static int All_Bicubic_Patch_Intersections(OBJECT *Object, RAY *Ray, ISTACK *Depth_Stack)
{
  int Found, cnt = 0;

  Found = false;

  Increase_Counter(stats[Ray_Bicubic_Tests]);

  switch (((BICUBIC_PATCH *)Object)->Patch_Type)
  {
    case 0:

      cnt = intersect_bicubic_patch0(Ray, ((BICUBIC_PATCH *)Object), Depth_Stack);

      break;

    case 1:

      cnt = bezier_tree_walker(Ray, (BICUBIC_PATCH *)Object, ((BICUBIC_PATCH *)Object)->Node_Tree, Depth_Stack);

      break;

    default:

      Error("Bad patch type in All_Bicubic_Patch_Intersections.");
  }
  
  if (cnt > 0)
  {
    Increase_Counter(stats[Ray_Bicubic_Tests_Succeeded]);
    
    Found = true;
  }
  
  return (Found);
}