-#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 );
- 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 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_init_default(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 );