+
+ if((player->subsystem != k_player_subsystem_dead) && !player->gate_waiting){
+ player->rewind_accum += vg.time_frame_delta;
+
+ if( player->rewind_accum > 0.25f ){
+ player->rewind_accum -= 0.25f;
+ player_save_rewind_frame( player );
+ }
+ }
+}
+
+/*
+ * Applies gate transport to a player_interface
+ */
+PLAYER_API
+void player__pass_gate( player_instance *player, ent_gate *gate )
+{
+ world_routes_fracture( world_current_instance(), gate,
+ player->rb.co, player->rb.v );
+
+ player->gate_waiting = gate;
+ world_routes_activate_entry_gate( world_current_instance(), gate );
+
+ m4x3_mulv( gate->transport, player->tpv_lpf, player->tpv_lpf );
+ m3x3_mulv( gate->transport, player->cam_velocity_smooth,
+ player->cam_velocity_smooth );
+
+ m3x3_copy( player->basis, player->basis_gate );
+
+ v4f q;
+ m3x3_q( gate->transport, q );
+ q_mul( q, player->qbasis, player->qbasis );
+ q_normalize( player->qbasis );
+ q_m3x3( player->qbasis, player->basis );
+ m3x3_transpose( player->basis, player->invbasis );
+
+ player->subsystem_gate = player->subsystem;
+ player->rb_gate_storage = player->rb;
+ v3_copy( player->angles, player->angles_storage );
+ player->rewind_length = 0;
+ player->rewind_total_length = 0.0f;
+ player->rewind_gate = gate;
+ player->rewind_accum = 0.0f;
+
+ m4x3_mulv( gate->transport, player->cam.pos, player->cam.pos );
+ player_save_rewind_frame( player );
+
+ if( gate->type == k_gate_type_nonlocel )
+ world_static.active_world = gate->target;
+
+ world_volumes.inside = 0;
+
+ audio_lock();
+ audio_oneshot( &audio_gate_pass, 1.0f, 0.0f );
+ audio_unlock();