Subversion Repositories gelsvn

Rev

Rev 319 | Rev 350 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 319 Rev 349
Line 460... Line 460...
460
  {
460
  {
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
 
-
 
466
    printf("%.2f %.2f %.2f\n", ray.dist, t_min, t_max);
465
//    if (!intersect_node(ray, *root, t_min, t_max))
467
//    if (!intersect_node(ray, *root, t_min, t_max))
466
//      return false;
468
//      return false;
467
//	cout << "____" << endl;
469
//  cout << "____" << endl;
468
//	ray.reset();
470
//  ray.reset();
469
//	cout << "Here " << endl;
471
//  cout << "Here " << endl;
470
    intersect_fast_node(ray, &fast_tree[0], t_min, t_max);
472
    intersect_fast_node(ray, &fast_tree[0], t_min, t_max);
471
    if (!ray.has_hit)
473
    if (!ray.has_hit)
472
      return false;
474
      return false;
473
    else 
475
    else 
474
    {
476
    {
-
 
477
 
-
 
478
        printf("HIT\n");
-
 
479
 
-
 
480
 
475
      // Calculate the normal at the intersection
481
      // Calculate the normal at the intersection
476
		ray.id = (int)ray.hit_object;
482
        ray.id = (int)ray.hit_object;
477
		ray.hit_object = trimesh[ray.id];
483
        ray.hit_object = trimesh[ray.id];
478
		
484
        
479
		Vec3i face = ray.hit_object->normals.face(ray.hit_face_id);
485
        Vec3i face = ray.hit_object->normals.face(ray.hit_face_id);