X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=player_skate.c;h=49cd6e76e76ccd2951e4a5f4d638f3e1b4ce12a2;hb=f48c3935c01da796b7ecb011a42d6576788b7648;hp=1ef19a1b6af6d67bdbddc6ebcc634f118d683803;hpb=9eb3de757a997becb8406417a4bf613f4cb04900;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/player_skate.c b/player_skate.c index 1ef19a1..49cd6e7 100644 --- a/player_skate.c +++ b/player_skate.c @@ -657,9 +657,9 @@ invalidated_grind:; } if( best ){ - v3_copy( best->n, s->land_normal ); + v3_copy( best->n, s->state.land_normal ); v3_copy( best->v, player->rb.v ); - s->land_dist = best->land_dist; + s->state.land_dist = best->land_dist; s->state.gravity_bias = best->gravity; @@ -671,8 +671,8 @@ invalidated_grind:; joystick_state( k_srjoystick_steer, steer ); v2_normalize_clamp( steer ); - if( (fabsf(steer[1]) > 0.5f) && (s->land_dist >= 1.5f) ){ - s->state.flip_rate = (1.0f/s->land_dist) * vg_signf(steer[1]) * + if( (fabsf(steer[1]) > 0.5f) && (s->state.land_dist >= 1.5f) ){ + s->state.flip_rate = (1.0f/s->state.land_dist) * vg_signf(steer[1]) * s->state.reverse ; s->state.flip_time = 0.0f; v3_copy( player->rb.to_world[0], s->state.flip_axis ); @@ -683,7 +683,7 @@ invalidated_grind:; } } else{ - v3_copy( player->basis[1], s->land_normal ); + v3_copy( player->basis[1], s->state.land_normal ); } } @@ -703,10 +703,10 @@ VG_STATIC void skate_apply_air_model( player_instance *player ) if( s->state.activity_prev > k_skate_activity_air_to_grind ) player__approximate_best_trajectory( player ); - float angle = v3_dot( player->rb.to_world[1], s->land_normal ); + float angle = v3_dot( player->rb.to_world[1], s->state.land_normal ); angle = vg_clampf( angle, -1.0f, 1.0f ); v3f axis; - v3_cross( player->rb.to_world[1], s->land_normal, axis ); + v3_cross( player->rb.to_world[1], s->state.land_normal, axis ); v4f correction; q_axis_angle( correction, axis, @@ -3152,7 +3152,7 @@ VG_STATIC void player__skate_animate( player_instance *player, t = sign * (1.0f-t*t); float angle = vg_clampf( t, -1.0f, 1.0f ) * VG_TAUf, - distm = s->land_dist * fabsf(s->state.flip_rate) * 3.0f, + distm = s->state.land_dist * fabsf(s->state.flip_rate) * 3.0f, blend = vg_clampf( 1.0f-distm, 0.0f, 1.0f ); angle = vg_lerpf( angle, vg_signf(s->state.flip_rate) * VG_TAUf, blend );