Subversion Repositories gelsvn

Rev

Rev 349 | Rev 364 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 349 Rev 350
Line 461... Line 461...
461
    double t_min, t_max;
461
    double t_min, t_max;
462
    bbox.intersect_min_max(ray, t_min, t_max);
462
    bbox.intersect_min_max(ray, t_min, t_max);
463
    if (t_min>t_max)
463
    if (t_min>t_max)
464
      return false;
464
      return false;
465
 
465
 
466
    printf("%.2f %.2f %.2f\n", ray.dist, t_min, t_max);
466
//    printf("%.2f %.2f %.2f\n", ray.dist, t_min, t_max);
467
//    if (!intersect_node(ray, *root, t_min, t_max))
467
    if (!intersect_node(ray, *root, t_min, t_max))
468
//      return false;
468
      return false;
469
//  cout << "____" << endl;
469
//  cout << "____" << endl;
470
//  ray.reset();
470
//  ray.reset();
471
//  cout << "Here " << endl;
471
//  cout << "Here " << endl;
472
    intersect_fast_node(ray, &fast_tree[0], t_min, t_max);
472
//    intersect_fast_node(ray, &fast_tree[0], t_min, t_max);
473
    if (!ray.has_hit)
473
    //  if (!ray.has_hit)
474
      return false;
474
    //return false;
475
    else 
475
    else 
476
    {
476
    {
477
 
477
 
478
        printf("HIT\n");
478
        //printf("HIT\n");
479
 
479
 
480
 
480
 
481
      // Calculate the normal at the intersection
481
      // Calculate the normal at the intersection
482
        ray.id = (int)ray.hit_object;
482
        ray.id = (int)ray.hit_object;
483
        ray.hit_object = trimesh[ray.id];
483
        ray.hit_object = trimesh[ray.id];