Subversion Repositories gelsvn

Rev

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

Rev 354 Rev 364
Line 477... Line 477...
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 = reinterpret_cast<int>(ray.hit_object);
482
        ray.id = reinterpret_cast<int>(ray.hit_object);
483
        ray.hit_object = trimesh[ray.id];
483
        ray.hit_object = trimesh[ray.id];
484
        
484
        
485
        Vec3i face = ray.hit_object->normals.face(ray.hit_face_id);
485
        Vec3i face = ray.hit_object->normals.face(ray.hit_face_id);
486
        Vec3f normal0 = ray.hit_object->normals.vertex(face[0]);
486
        Vec3f normal0 = ray.hit_object->normals.vertex(face[0]);
487
        Vec3f normal1 = ray.hit_object->normals.vertex(face[1]);
487
        Vec3f normal1 = ray.hit_object->normals.vertex(face[1]);
Line 519... Line 519...
519
 
519
 
520
  void BSPTree::push_fast_bsp_node(BSPNode *node, int id) 
520
  void BSPTree::push_fast_bsp_node(BSPNode *node, int id) 
521
  {
521
  {
522
    if (node->axis_leaf==4)  // It is a leaf
522
    if (node->axis_leaf==4)  // It is a leaf
523
    {
523
    {
524
        assert(false);
524
        //assert(false);
525
        //TODO: cant compile on 64 bit gcc
525
        //TODO: cant compile on 64 bit gcc
526
 
526
 
527
        //fast_tree[id].leaf.flagAndOffset = (unsigned int)1<<31 | (unsigned int)(&all_triaccel[node->id]);
527
        //fast_tree[id].leaf.flagAndOffset = (unsigned int)1<<31 | (unsigned int)(&all_triaccel[node->id]);
528
      fast_tree[id].leaf.count = node->count;
528
      fast_tree[id].leaf.count = node->count;
529
    } 
529
    } 
Line 534... Line 534...
534
      fast_tree.push_back(fnode); // left
534
      fast_tree.push_back(fnode); // left
535
      fast_tree.push_back(fnode); // right
535
      fast_tree.push_back(fnode); // right
536
      push_fast_bsp_node(node->left, p_l);
536
      push_fast_bsp_node(node->left, p_l);
537
      push_fast_bsp_node(node->right, p_l+1);
537
      push_fast_bsp_node(node->right, p_l+1);
538
 
538
 
539
      assert(false);
539
      //assert(false);
540
      //TODO: gcc64 bit failure
540
      //TODO: gcc64 bit failure
541
 
541
 
542
      //fast_tree[id].inner.flagAndOffset = (unsigned int) &fast_tree[p_l] | node->axis_leaf;
542
      //fast_tree[id].inner.flagAndOffset = (unsigned int) &fast_tree[p_l] | node->axis_leaf;
543
      fast_tree[id].inner.splitCoordinate = node->plane;
543
      fast_tree[id].inner.splitCoordinate = node->plane;
544
      node->ref = fast_tree[id].inner.flagAndOffset;
544
      node->ref = fast_tree[id].inner.flagAndOffset;