the coolest fucking thing ive ever made
[carveJwlIkooP6JGAAIwe30JlM.git] / world.h
diff --git a/world.h b/world.h
index 7f8432ab08d9f0630777be8aa1e33db78cac529f..ba5d5e4b7409e7f57492aaef82cad54675cbf02a 100644 (file)
--- a/world.h
+++ b/world.h
@@ -124,7 +124,7 @@ static struct gworld
       }
       *routes;
 
-      double last_interaction;
+      double time, rewind_from, rewind_to, last_use;
 
       u32 route_count,
           route_cap;
@@ -193,6 +193,8 @@ static struct gworld
 #if 0
    traffic_driver van_man[6];
 #endif
+
+   double sky_time, sky_rate, sky_target_rate;
    
    /* Physics */
    
@@ -225,7 +227,7 @@ static struct gworld
    v3f render_gate_pos;
    int active_route_board;
 }
-world;
+world ;
 
 /*
  * API
@@ -254,6 +256,9 @@ static int ray_world( v3f pos, v3f dir, ray_hit *hit );
 
 static void world_init(void)
 {
+   world.sky_rate = 1.0;
+   world.sky_target_rate = 1.0;
+
    shader_terrain_register();
    shader_sky_register();
    shader_planeinf_register();
@@ -304,6 +309,10 @@ static void world_free( void *_ )
 
 static void world_update( v3f pos )
 {
+   world.sky_time += world.sky_rate * vg.time_delta;
+   world.sky_rate = vg_lerp( world.sky_rate, world.sky_target_rate, 
+                                 vg.time_delta * 10.0 );
+
    world_routes_update();
 #if 0
    world_routes_debug();