X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=world.h;h=29e1e714b6453576dc9e510e5951fc6b0a227c83;hb=eb6573694ca9292baaefee233dedb0b79f3ddc2e;hp=2ca8725bfa602eb06c229e7d6d9a693eeb651214;hpb=39378a28bc0b7c9beaf9f2191f5dc51b8c8865a0;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/world.h b/world.h index 2ca8725..29e1e71 100644 --- a/world.h +++ b/world.h @@ -36,6 +36,8 @@ static void render_world( m4x4f projection, m4x3f camera ) scene_bind( &world.foliage ); scene_draw( &world.foliage ); glEnable(GL_CULL_FACE); + + vg_line_boxf( world.geo.bbx, 0xff00ffff ); } static void ray_world_get_tri( ray_hit *hit, v3f tri[3] ) @@ -60,14 +62,27 @@ static void world_load(void) scene_init( &world.geo ); model *mworld = vg_asset_read( "models/mp_dev.mdl" ); - scene_add_model( &world.geo, mworld, submodel_get( mworld, "mp_dev" ), - (v3f){0.0f,0.0f,0.0f}, 0.0f, 1.0f ); + for( int i=0; ilayer_count; i++ ) + { + submodel *sm = model_get_submodel( mworld, i ); + if( !strcmp( sm->material, "surf" ) ) + scene_add_model( &world.geo, mworld, sm, sm->pivot, 0.0f, 1.0f ); + + } scene_copy_slice( &world.geo, &world.sm_road ); - scene_add_model( &world.geo, mworld, submodel_get( mworld, "terrain" ), - (v3f){0.0f,0.0f,0.0f}, 0.0f, 1.0f ); + for( int i=0; ilayer_count; i++ ) + { + submodel *sm = model_get_submodel( mworld, i ); + if( !strcmp( sm->material, "terrain" ) ) + scene_add_model( &world.geo, mworld, sm, sm->pivot, 0.0f, 1.0f ); + } + scene_copy_slice( &world.geo, &world.sm_terrain ); + /* + * TODO: Parametric marker import + */ v3_copy( model_marker_get( mworld, "mp_dev_tutorial" )->co, world.tutorial ); @@ -92,7 +107,9 @@ static void world_load(void) } #endif - /* WATER DEV */ + /* WATER DEV + * again, TODO: parametric import (material) + */ { glmesh surf; submodel *sm = submodel_get(mworld,"mp_dev_water");