-VG_STATIC void player_walk_ui( player_interface *player,
- player_attachment *at )
-{
- player_debugtext( 1, "V: %5.2f %5.2f %5.2f",player->rb.v[0],
- player->rb.v[1],
- player->rb.v[2] );
- player_debugtext( 1, "CO: %5.2f %5.2f %5.2f",player->rb.co[0],
- player->rb.co[1],
- player->rb.co[2] );
+ teleport_gate *gate;
+ if( (gate = world_intersect_gates( player->rb.co, w->state.prev_pos )) )
+ {
+ struct player_device_walk *w = at->storage;
+
+ m4x3_mulv( gate->transport, player->rb.co, player->rb.co );
+ m3x3_mulv( gate->transport, player->rb.v, player->rb.v );
+ rb_update_transform( &player->rb );
+
+ /* analytical rotation of yaw */
+ v3f fwd_dir = { cosf(w->state.angles[0]),
+ 0.0f,
+ sinf(w->state.angles[0])};
+ m3x3_mulv( gate->transport, fwd_dir, fwd_dir );
+ w->state.angles[0] = atan2f( fwd_dir[2], fwd_dir[0] );
+
+ w->state_gate_storage = w->state;
+ player_pass_gate( player, gate );
+ }