X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=player.h;h=38c3224de7fd1ab06f2b4034c467ca23c6c3ed4d;hb=15beb60ade240af4e00b0d204f7e89a4d35dca36;hp=25054e03f38db5040af9c9437364e99d9a4adc71;hpb=8bc80dc83f08a7016f1057f82d00727a2e417fa3;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/player.h b/player.h index 25054e0..38c3224 100644 --- a/player.h +++ b/player.h @@ -17,7 +17,8 @@ static float k_board_radius = 0.3f, k_board_length = 0.45f, k_board_allowance = 0.04f, - k_friction_lat = 8.8f, + //k_friction_lat = 8.8f, + k_friction_lat = 12.0f, k_friction_resistance = 0.01f, k_max_push_speed = 16.0f, k_push_accel = 10.0f, @@ -27,6 +28,7 @@ static float k_steer_air_lerp = 0.3f, k_pump_force = 0.0f, k_downforce = 5.0f, + k_walk_downforce = 8.0f, k_jump_charge_speed = (1.0f/1.0f), k_jump_force = 5.0f, k_pitch_limit = 1.5f, @@ -69,7 +71,10 @@ static struct gplayer phys, phys_gate_frame; - int is_dead; + m4x3f visual_transform, + inv_visual_transform; + + int is_dead, death_tick_allowance; v3f land_target; v3f land_target_log[22]; @@ -97,8 +102,10 @@ static struct gplayer fsetup, walk_timer, fjump, - fonboard; + fonboard, + frun; + float walk; int step_phase; /* player model */ @@ -113,7 +120,8 @@ static struct gplayer *anim_push, *anim_push_reverse, *anim_ollie, *anim_ollie_reverse, *anim_grabs, *anim_stop, - *anim_walk, *anim_run, *anim_idle; + *anim_walk, *anim_run, *anim_idle, + *anim_jump; u32 id_hip, id_ik_hand_l, @@ -235,6 +243,7 @@ static void player_update_pre(void) if( vg_get_button_down( "reset" ) ) { player.is_dead = 0; + player.death_tick_allowance = 30; player_restore_frame(); if( !phys->on_board ) @@ -262,6 +271,9 @@ static void player_update_pre(void) static void player_update_fixed(void) /* 2 */ { + if( player.death_tick_allowance ) + player.death_tick_allowance --; + struct player_phys *phys = &player.phys; if( player.is_dead ) @@ -306,7 +318,7 @@ static void player_update_post(void) player_camera_update(); } -static void draw_player(void) /* 3 */ +static void draw_player( m4x3f cam ) { if( player.is_dead ) player_model_copy_ragdoll(); @@ -314,7 +326,7 @@ static void draw_player(void) /* 3 */ shader_viewchar_use(); vg_tex2d_bind( &tex_characters, 0 ); shader_viewchar_uTexMain( 0 ); - shader_viewchar_uCamera( player.camera[3] ); + shader_viewchar_uCamera( cam[3] ); shader_viewchar_uPv( vg.pv ); shader_link_standard_ub( _shader_viewchar.id, 2 ); glUniformMatrix4x3fv( _uniform_viewchar_uTransforms, @@ -339,8 +351,11 @@ static float *player_get_pos(void) static void player_kill(void) { - player.is_dead = 1; - player_ragdoll_copy_model( player.phys.rb.v ); + if( player.death_tick_allowance == 0 ) + { + player.is_dead = 1; + player_ragdoll_copy_model( player.phys.rb.v ); + } } static float *player_cam_pos(void)