+VG_STATIC int rb_sphere__scene( m4x3f mtxA, rb_sphere *b,
+ m4x3f mtxB, rb_scene *s, rb_ct *buf )
+{
+ scene *sc = s->bh_scene->user;
+
+ bh_iter it;
+ bh_iter_init( 0, &it );
+ int idx;
+
+ int count = 0;
+
+ float r = b->radius;
+ boxf box;
+ v3_sub( mtxA[3], (v3f){ r,r,r }, box[0] );
+ v3_add( mtxA[3], (v3f){ r,r,r }, box[1] );
+
+ while( bh_next( s->bh_scene, &it, box, &idx ) )
+ {
+ u32 *ptri = &sc->arrindices[ idx*3 ];
+ v3f tri[3];
+
+ for( int j=0; j<3; j++ )
+ v3_copy( sc->arrvertices[ptri[j]].co, tri[j] );
+
+ buf[ count ].element_id = ptri[0];
+
+ vg_line( tri[0],tri[1],0x70ff6000 );
+ vg_line( tri[1],tri[2],0x70ff6000 );
+ vg_line( tri[2],tri[0],0x70ff6000 );
+
+ int contact = rb_sphere__triangle( mtxA, b, tri, &buf[count] );
+ count += contact;
+
+ if( count == 16 )
+ {
+ vg_warn( "Exceeding sphere_vs_scene capacity. Geometry too dense!\n" );
+ return count;
+ }
+ }
+
+ return count;
+}
+
+__attribute__ ((deprecated))