projects
/
carveJwlIkooP6JGAAIwe30JlM.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
loader stuff
[carveJwlIkooP6JGAAIwe30JlM.git]
/
world.h
diff --git
a/world.h
b/world.h
index 66b3b28f2c0b14a961cf7ea04ef4b27321332cc7..98d7efbe611fdab0930a5e880f5bbf2a40b4accd 100644
(file)
--- a/
world.h
+++ b/
world.h
@@
-681,12
+681,12
@@
VG_STATIC void world_update( world_instance *world, v3f pos )
v3_sub( pos, (v3f){ radius, radius, radius }, volume_proximity[0] );
bh_iter it;
v3_sub( pos, (v3f){ radius, radius, radius }, volume_proximity[0] );
bh_iter it;
- bh_iter_init
( 0, &it
);
- i
nt
idx;
+ bh_iter_init
_box( 0, &it, volume_proximity
);
+ i
32
idx;
int in_volume = 0;
int in_volume = 0;
- while( bh_next( world->volume_bh, &it,
volume_proximity,
&idx ) ){
+ while( bh_next( world->volume_bh, &it, &idx ) ){
ent_volume *volume = mdl_arritm( &world->ent_volume, idx );
boxf cube = {{-1.0f,-1.0f,-1.0f},{1.0f,1.0f,1.0f}};
ent_volume *volume = mdl_arritm( &world->ent_volume, idx );
boxf cube = {{-1.0f,-1.0f,-1.0f},{1.0f,1.0f,1.0f}};
@@
-776,9
+776,6
@@
VG_STATIC int ray_world( world_instance *world,
VG_STATIC int spherecast_world( world_instance *world,
v3f pa, v3f pb, float r, float *t, v3f n )
{
VG_STATIC int spherecast_world( world_instance *world,
v3f pa, v3f pb, float r, float *t, v3f n )
{
- bh_iter it;
- bh_iter_init( 0, &it );
-
boxf region;
box_init_inf( region );
box_addpt( region, pa );
boxf region;
box_init_inf( region );
box_addpt( region, pa );
@@
-798,8
+795,10
@@
VG_STATIC int spherecast_world( world_instance *world,
int hit = -1;
float min_t = 1.0f;
int hit = -1;
float min_t = 1.0f;
- int idx;
- while( bh_next( world->geo_bh, &it, region, &idx ) ){
+ bh_iter it;
+ bh_iter_init_box( 0, &it, region );
+ i32 idx;
+ while( bh_next( world->geo_bh, &it, &idx ) ){
u32 *ptri = &world->scene_geo.arrindices[ idx*3 ];
v3f tri[3];
u32 *ptri = &world->scene_geo.arrindices[ idx*3 ];
v3f tri[3];