-#include "water.h"
-
-#include "shaders/standard.h"
-
-static struct gworld
-{
- scene geo, foliage;
- submodel sm_road, sm_terrain;
- glmesh skybox;
-
- v3f tutorial;
-}
-world;
-
-static void render_world( m4x4f projection, m4x3f camera )
-{
- render_sky( camera );
-
- m4x3f identity_matrix;
- m4x3_identity( identity_matrix );
-
- render_terrain( projection, camera[3] );
- scene_bind( &world.geo );
- scene_draw( &world.geo );
-
- glDisable(GL_CULL_FACE);
- scene_bind( &world.foliage );
- scene_draw( &world.foliage );
- glEnable(GL_CULL_FACE);
-}
-
-static void ray_world_get_tri( ray_hit *hit, v3f tri[3] )
-{
- for( int i=0; i<3; i++ )
- v3_copy( world.geo.verts[ hit->tri[i] ].co, tri[i] );
-}
-
-static int ray_world( v3f pos, v3f dir, ray_hit *hit )
-{
- return bvh_raycast( &world.geo, pos, dir, hit );
-}
-
-static int ray_hit_is_ramp( ray_hit *hit )
-{
- return hit->tri[0] < world.sm_road.vertex_count;
-}
-
-static void world_load(void)
-{
- /* Setup scene */
- 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 );
- 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 );
- scene_copy_slice( &world.geo, &world.sm_terrain );
-
- v3_copy( model_marker_get( mworld, "mp_dev_tutorial" )->co, world.tutorial );
-
-
- /* GATE DEV */
-#if 0
- {
- model_marker *ga = model_marker_get(mworld,"gate_a"),
- *gb = model_marker_get(mworld,"gate_a_recv");