X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=player_skate.c;h=50247502224d9b27963e44d9db793f256ddb9e90;hb=22aab5cc99ed5b927c57f0fd8fa65b33575101a6;hp=7014c778afcdba4d3d0b49e465923e9f2b64d994;hpb=1a194c3888293733939b2dd944251ae1b6c398ce;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/player_skate.c b/player_skate.c index 7014c77..5024750 100644 --- a/player_skate.c +++ b/player_skate.c @@ -14,6 +14,7 @@ #include "player_glide.h" #include "player_dead.h" #include "player_walk.h" +#include struct player_skate player_skate; struct player_subsystem_interface player_subsystem_skate = @@ -1094,10 +1095,11 @@ static void skate_apply_pump_model(void){ } else{ /* Collect */ - float doty = v3_dot( localplayer.rb.to_world[1], state->throw_v ); + f32 doty = v3_dot( localplayer.rb.to_world[1], state->throw_v ); v3f Fl, Fv; v3_muladds( state->throw_v, localplayer.rb.to_world[1], -doty, Fl); + player_skate.collect_feedback = v3_length(Fl) * 4.0f; if( state->activity == k_skate_activity_ground ){ if( v3_length2(localplayer.rb.v)<(20.0f*20.0f) ){ @@ -1108,7 +1110,7 @@ static void skate_apply_pump_model(void){ } v3_muls( localplayer.rb.to_world[1], -doty, Fv ); - v3_muladds( localplayer.rb.v, Fv, k_mmcollect_vert, localplayer.rb.v ); + v3_muladds( localplayer.rb.v, Fv, k_mmcollect_vert, localplayer.rb.v ); v3_muladds( state->throw_v, Fv, k_mmcollect_vert, state->throw_v ); } @@ -2229,20 +2231,10 @@ void player__skate_update(void){ struct player_skate_state *state = &player_skate.state; world_instance *world = world_current_instance(); - if( state->activity == k_skate_activity_handplant ){ + if( state->activity == k_skate_activity_handplant ) return; - } - if( world->water.enabled ){ - if( localplayer.rb.co[1]+0.25f < world->water.height ){ - vg_info( "player fell off due to being in water\n" ); - player__networked_sfx( k_player_subsystem_walk, 32, - k_player_walk_soundeffect_splash, - localplayer.rb.co, 1.0f ); - player__dead_transition( k_player_die_type_generic ); - return; - } - } + if( !world_water_player_safe( world, 0.25f ) ) return; v3_copy( localplayer.rb.co, state->prev_pos ); state->activity_prev = state->activity; @@ -2804,15 +2796,16 @@ begin_collision:; } } -void player__skate_im_gui(void){ +void player__skate_im_gui( ui_context *ctx ) +{ struct player_skate_state *state = &player_skate.state; - player__debugtext( 1, "V: %5.2f %5.2f %5.2f",localplayer.rb.v[0], + player__debugtext( ctx, 1, "V: %5.2f %5.2f %5.2f",localplayer.rb.v[0], localplayer.rb.v[1], localplayer.rb.v[2] ); - player__debugtext( 1, "CO: %5.2f %5.2f %5.2f",localplayer.rb.co[0], + player__debugtext( ctx, 1, "CO: %5.2f %5.2f %5.2f",localplayer.rb.co[0], localplayer.rb.co[1], localplayer.rb.co[2] ); - player__debugtext( 1, "W: %5.2f %5.2f %5.2f",localplayer.rb.w[0], + player__debugtext( ctx, 1, "W: %5.2f %5.2f %5.2f",localplayer.rb.w[0], localplayer.rb.w[1], localplayer.rb.w[2] ); @@ -2830,19 +2823,14 @@ void player__skate_im_gui(void){ "grind_5050" }; - player__debugtext( 1, "activity: %s", activity_txt[state->activity] ); -#if 0 - player__debugtext( 1, "steer_s: %5.2f %5.2f [%.2f %.2f]", - state->steerx_s, state->steery_s, - k_steer_ground, k_steer_air ); -#endif - player__debugtext( 1, "flip: %.4f %.4f", state->flip_rate, + player__debugtext( ctx, 1, "activity: %s", activity_txt[state->activity] ); + player__debugtext( ctx, 1, "flip: %.4f %.4f", state->flip_rate, state->flip_time ); - player__debugtext( 1, "trickv: %.2f %.2f %.2f", + player__debugtext( ctx, 1, "trickv: %.2f %.2f %.2f", state->trick_vel[0], state->trick_vel[1], state->trick_vel[2] ); - player__debugtext( 1, "tricke: %.2fs %.2f %.2f %.2f", + player__debugtext( ctx, 1, "tricke: %.2fs %.2f %.2f %.2f", state->trick_time, state->trick_euler[0], state->trick_euler[1],