v3_cross( localplayer.basis[1], player_walk.state.drop_in_normal, axis );
v3_cross( axis, player_walk.state.drop_in_normal, init_dir );
v3_normalize( init_dir );
- v3_muls( init_dir, 7.0f, vec );
+ v3_muls( init_dir, 4.25f, vec );
}
static float player_xyspeed2(void){
if( !localplayer.immobile )
player_look( localplayer.angles, skaterift.time_rate );
+ v2f steer;
+ joystick_state( k_srjoystick_steer, steer );
+
+ if( w->state.activity == k_walk_activity_sit ){
+ if( w->state.sit_t < 1.0f )
+ w->state.sit_t = vg_minf( 1.0f, w->state.sit_t + vg.time_delta );
+
+ if( button_down(k_srbind_sit) || (v2_length2(steer)>0.2f) ||
+ button_down(k_srbind_jump) ){
+ w->state.activity = k_walk_activity_sit_up;
+ }
+ return;
+ }
+ else if( w->state.activity == k_walk_activity_sit_up ){
+ if( w->state.sit_t > 0.0f )
+ w->state.sit_t = vg_maxf( 0.0f, w->state.sit_t - vg.time_delta );
+ else
+ w->state.activity = k_walk_activity_ground;
+
+ if( button_down(k_srbind_sit) )
+ w->state.activity = k_walk_activity_sit;
+
+ return;
+ }
+ else if( w->state.activity == k_walk_activity_ground ){
+ if( button_down(k_srbind_sit) ){
+ v3_zero( localplayer.rb.v );
+ w->state.activity = k_walk_activity_sit;
+ return;
+ }
+ }
+
+ w->state.sit_t = 0.0f;
+
if( w->state.outro_type ){
struct skeleton_anim *anim = player_walk_outro_anim(w->state.outro_type);
v2f steer;
joystick_state( k_srjoystick_steer, steer );
- if( w->state.activity == k_walk_activity_sit ){
- if( w->state.sit_t < 1.0f )
- w->state.sit_t += vg.time_delta;
- else {
- w->state.sit_t = 1.0f;
-
- if( button_down(k_srbind_sit) || (v2_length2(steer)>0.2f) ||
- button_down(k_srbind_jump) ){
- w->state.activity = k_walk_activity_sit_up;
- }
- }
+ if( (w->state.activity == k_walk_activity_sit) ||
+ (w->state.activity == k_walk_activity_sit_up) ){
return;
}
- else if( w->state.activity == k_walk_activity_sit_up ){
- if( w->state.sit_t > 0.0f ){
- w->state.sit_t -= vg.time_delta;
- return;
- }
- }
- else
- w->state.sit_t = 0.0f;
v3_copy( localplayer.rb.co, w->state.prev_pos );
v3_zero( localplayer.rb.w );
if( w->state.activity == k_walk_activity_ground ){
v3_normalize( surface_avg );
- if( button_down(k_srbind_sit) ){
- w->state.activity = k_walk_activity_sit;
- return;
- }
-
v3f tx, ty;
v3_tangent_basis( surface_avg, tx, ty );
animator->walk_timer = w->state.walk_timer;
- if( !localplayer.immobile )
- rb_extrapolate( &localplayer.rb, animator->root_co, animator->root_q );
- else{
+ if( localplayer.immobile || (w->state.outro_type == k_walk_outro_drop_in) ){
v3_copy( localplayer.rb.co, animator->root_co );
v4_copy( localplayer.rb.q, animator->root_q );
}
+ else{
+ rb_extrapolate( &localplayer.rb, animator->root_co, animator->root_q );
+ }
f32 walk_yaw = player_get_heading_yaw();
v3_lerp( w->state.drop_in_start, w->state.drop_in_target,
step_t, localplayer.rb.co );
+ v3_copy( localplayer.rb.co, animator->root_co );
+
+ /* for the camera purposes only */
+ v3f init_velocity;
+ player_walk_drop_in_vector( init_velocity );
+ v3_muls( init_velocity, dop_t, localplayer.rb.v );
+ v3_copy( localplayer.rb.v,
+ localplayer.cam_control.cam_velocity_smooth );
+
q_axis_angle( animator->root_q, (v3f){0.0f,1.0f,0.0f},
walk_yaw + VG_PIf );
/* the drop in bit */
if( step_t >= 1.0f ){
+ v3f final_co;
v4f final_q;
- player_walk_drop_in_overhang_transform( dop_t, localplayer.rb.co,
- final_q );
+ player_walk_drop_in_overhang_transform( dop_t, final_co, final_q );
+
q_mul( final_q, animator->root_q, animator->root_q );
+ v3_copy( final_co, animator->root_co );
+
v4_copy( animator->root_q, localplayer.rb.q );
+ rb_update_transform( &localplayer.rb );
+
v3_muladds( animator->root_co, localplayer.rb.to_world[1],
-0.1f*dop_t, animator->root_co );
+ v3_copy( animator->root_co, localplayer.rb.co );
}
+
return;
}
else{