X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=player.c;h=860e04885a31c08f70a6814c02b13244efff1fc2;hb=f2c77307831c6f971dcad62552cbe57fa99bce98;hp=b1788c626e8a410d148849144afa4bed296592ed;hpb=2c91a71533b4ce86b9e7fd708420ae05c74d8f52;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/player.c b/player.c index b1788c6..860e048 100644 --- a/player.c +++ b/player.c @@ -11,10 +11,11 @@ #include "network.h" #include "network_common.h" #include "world_routes.h" +#include "ent_miniworld.h" static int localplayer_cmd_respawn( int argc, const char *argv[] ){ ent_spawn *rp = NULL, *r; - world_instance *world = localplayer.viewable_world; + world_instance *world = world_current_instance(); if( argc == 1 ){ rp = world_find_spawn_by_name( world, argv[0] ); @@ -131,16 +132,13 @@ static void player__pass_gate( u32 id ){ m4x3_mulv( gate->transport, cc->tpv_lpf, cc->tpv_lpf ); m3x3_mulv( gate->transport, cc->cam_velocity_smooth, cc->cam_velocity_smooth ); - m3x3_copy( localplayer.basis, localplayer.basis_gate ); - - v4f q; - m3x3_q( gate->transport, q ); - q_mul( q, localplayer.qbasis, localplayer.qbasis ); - q_normalize( localplayer.qbasis ); - q_m3x3( localplayer.qbasis, localplayer.basis ); - m3x3_transpose( localplayer.basis, localplayer.invbasis ); m4x3_mulv( gate->transport, localplayer.cam.pos, localplayer.cam.pos ); + + v3f v0; + v3_angles_vector( localplayer.angles, v0 ); + m3x3_mulv( gate->transport, v0, v0 ); + v3_angles( v0, localplayer.angles ); audio_lock(); audio_oneshot( &audio_gate_pass, 1.0f, 0.0f ); @@ -202,13 +200,11 @@ static void player__im_gui(void){ [k_skaterift_replay] = "replay", [k_skaterift_ent_focus] = "ent_focus", [k_skaterift_default] = "default", - [k_skaterift_respawning]= "respawning", } [skaterift.activity] ); player__debugtext( 1, "time_rate: %.4f", skaterift.time_rate ); player__debugtext( 2, "player" ); player__debugtext( 1, "angles: " PRINTF_v3f( localplayer.cam.angles ) ); - player__debugtext( 1, "basis: " PRINTF_v4f( localplayer.qbasis ) ); if( player_subsystems[ localplayer.subsystem ]->im_gui ) player_subsystems[ localplayer.subsystem ]->im_gui(); @@ -234,16 +230,11 @@ static void player__reset(void){ rb_update_transform( &localplayer.rb ); - q_identity( localplayer.qbasis ); - m3x3_identity( localplayer.basis ); - m3x3_identity( localplayer.invbasis ); - localplayer.subsystem = k_player_subsystem_walk; player__walk_reset(); localplayer.immobile = 0; localplayer.gate_waiting = NULL; - localplayer.viewable_world = world_current_instance(); world_static.challenge_target = NULL; world_static.challenge_timer = 0.0f; @@ -260,6 +251,8 @@ static void player__reset(void){ world_routes_clear( instance ); } } + + v3_copy( localplayer.rb.co, localplayer.cam_control.tpv_lpf ); } static void player__spawn( ent_spawn *rp ){