// if so, move yaw = move yaw ideal, and we can calculate foot yaw by an accuracy of ~45 degrees
if( started_moving_this_frame && previous_record->layers[ 6 ].weight <= 0.f && !record->in_air( ) )
{
const float local_cycle_increment = record->layers[ 6 ].playback_rate;
float raw_yaw_ideal = atan2( -record->anim_velocity.y, -record->anim_velocity.x ) * 180.f /
constants::pi;
if( raw_yaw_ideal < 0.f )
raw_yaw_ideal += 360.f;
const int move_seq = record->layers[ 6 ].sequence;
float move_yaw = FLT_MAX;
constexpr std::array angles = { 180.f, 135.f, 90.f, 45.f, 0.f, -45.f, -90.f, -135.f };
for( int i = animtag_startcycle_n; i <= animtag_startcycle_nw; i++ )
{
const float pred_cycle = player->animation_state( )->clamp_cycle(
player->first_sequence_anim_tag( move_seq, i ) + local_cycle_increment );
if( static_cast< int >( pred_cycle * 1000.f ) == static_cast< int >( record->layers[
animation_layer_movement_move ].cycle * 1000.f ) )
{
move_yaw = angles[ i - animtag_startcycle_n ];
break;
}
}
if( move_yaw != FLT_MAX )
{
const float foot_yaw = g_math.angle_normalize( g_math.angle_diff( raw_yaw_ideal, move_yaw ) );
}
}