+
+ if( (state->activity_prev < k_skate_activity_grind_any) &&
+ (state->activity >= k_skate_activity_grind_any) ){
+ state->velocity_limit = v3_length( localplayer.rb.v );
+ state->grind_y_start = localplayer.rb.co[1];
+ }
+
+ if( state->activity >= k_skate_activity_grind_any ){
+ f32 dy = localplayer.rb.co[1] - state->grind_y_start;
+ if( dy < 0.0f ){
+ state->velocity_limit += -dy*0.2f;
+ }
+ state->grind_y_start = localplayer.rb.co[1];
+
+
+ f32 speed_end = v3_length( localplayer.rb.v );
+ if( speed_end > state->velocity_limit ){
+ v3_muls( localplayer.rb.v, state->velocity_limit/speed_end,
+ localplayer.rb.v );
+ }
+ }