}
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;
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 );
}
}
else{
- v3_copy( player->basis[1], s->land_normal );
+ v3_copy( player->basis[1], s->state.land_normal );
}
}
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,
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 );