X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;ds=sidebyside;f=bvh.h;h=52ce24ab75e39175923ab95a00e508882349afe8;hb=0136a935c00e3ea1f231fd88b38b44982fd409ac;hp=8b6b0784785973f1adf89ddbbb01636d656f1d64;hpb=6c1541ad6a2915912e7439661820a786cb145af4;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/bvh.h b/bvh.h index 8b6b078..52ce24a 100644 --- a/bvh.h +++ b/bvh.h @@ -90,7 +90,6 @@ VG_STATIC void bh_subdivide( bh_tree *bh, u32 inode ) if( extent[2] > extent[axis] ) axis = 2; float split = node->bbx[0][axis] + extent[axis]*0.5f; - float avg = 0.0; for( u32 t=0; tcount; t++ ) { @@ -98,9 +97,9 @@ VG_STATIC void bh_subdivide( bh_tree *bh, u32 inode ) avg += bh->system->item_centroid( bh->user, idx, axis ); } avg /= (float)node->count; - split = avg; + i32 i = node->start, j = i + node->count-1;