X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=bvh.h;fp=bvh.h;h=52ce24ab75e39175923ab95a00e508882349afe8;hb=192990d6d24e53749ca046fef808a63cf162ab8a;hp=8b6b0784785973f1adf89ddbbb01636d656f1d64;hpb=34a8df54eb962f3ad2e036355041f5bc5cabe5a0;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;