remove dead code
authorhgn <hgodden00@gmail.com>
Mon, 7 Aug 2023 10:24:01 +0000 (11:24 +0100)
committerhgn <hgodden00@gmail.com>
Mon, 7 Aug 2023 10:24:01 +0000 (11:24 +0100)
bvh.h
scene.h

diff --git a/bvh.h b/bvh.h
index ce7fbe078e46ee1b126289307f718cace03bb85e..0865ee7d6f0bb16c64a2559c797db7c87d00747c 100644 (file)
--- a/bvh.h
+++ b/bvh.h
@@ -210,57 +210,6 @@ VG_STATIC void bh_debug_trace( bh_tree *bh, u32 inode, v3f pos, u32 colour ){
    }
 }
 
-#if 0
-VG_STATIC int bh_ray( bh_tree *bh, v3f co, v3f dir, ray_hit *hit ){
-   if( bh->node_count < 2 )
-      return 0;
-
-   int count = 0;
-   u32 stack[100];
-   u32 depth = 2;
-
-   stack[0] = 0;
-   stack[1] = bh->nodes[0].il;
-   stack[2] = bh->nodes[0].ir;
-
-   v3f dir_inv;
-   v3_div( (v3f){1.0f,1.0f,1.0f}, dir, dir_inv );
-   
-   while(depth){
-      bh_node *inode = &bh->nodes[ stack[depth] ];
-      if( ray_aabb1( inode->bbx, co, dir_inv, hit->dist ) ){
-         if( inode->count ){
-            for( u32 i=0; i<inode->count; i++ ){
-               u32 idx = inode->start+i;
-
-               if( bh->system->cast_ray )
-                  count += bh->system->cast_ray( bh->user, idx, co, dir, hit );
-               else
-                  count ++;
-            }
-
-            depth --;
-         }
-         else{
-            if( depth+1 >= vg_list_size(stack) ){
-               vg_error( "Maximum stack reached!\n" );
-               return count;
-            }
-
-            stack[depth] = inode->il;
-            stack[depth+1] = inode->ir;
-            depth ++;
-         }
-      }
-      else{
-         depth --;
-      }
-   }
-
-   return count;
-}
-#endif
-
 typedef struct bh_iter bh_iter;
 struct bh_iter{
    struct {
diff --git a/scene.h b/scene.h
index cee7e699f6f570831ddaad9cca143095d1471706..b54587aadf1a1064019bedf7882fd0140eb6b4f7 100644 (file)
--- a/scene.h
+++ b/scene.h
@@ -371,31 +371,6 @@ VG_STATIC void scene_bh_debug( void *user, u32 item_index )
    vg_line( pc->co, pa->co, 0xff0000ff );
 }
 
-#if 0
-VG_STATIC int scene_bh_ray( void *user, u32 index, v3f co, 
-                            v3f dir, ray_hit *hit )
-{
-   scene_context *s = user;
-   v3f positions[3];
-   
-   u32 *tri = &s->arrindices[ index*3 ];
-
-   for( int i=0; i<3; i++ )
-      v3_copy( s->arrvertices[tri[i]].co, positions[i] );
-   
-   float t;
-   if(ray_tri( positions, co, dir, &t )){
-      if( t < hit->dist ){
-         hit->dist = t;
-         hit->tri = tri;
-         return 1;
-      }
-   }
-
-   return 0;
-}
-#endif
-
 VG_STATIC void scene_bh_closest( void *user, u32 index, v3f point, v3f closest )
 {
    scene_context *s = user;