ЧВК EB_LAN
-
Автор темы
- #1
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
C++:
auto calc_playback_rate = [ & ]( c_csplayer* player, const float& velocity_delta, float move_dist = -1.0f ) {
auto state = player->animstate( );
auto anim_layer = player->anim_overlay( )[ 6 ];
auto move_yaw = player->pose_parameter()[ 7 ];
player->pose_parameter( )[ 7 ] = velocity_delta;
auto seq_dur = player->get_sequence_cycle_rate( player->get_studio_hdr( ), anim_layer.sequence );
float v56;
if ( seq_dur <= 0.0f )
v56 = 10.0f;
else
v56 = 1.0f / seq_dur;
float v237 = 1.0f / ( 1.0f / v56 );
auto dist = move_dist;
if ( move_dist == -1.0f ) {
dist = player->get_sequence_move_dist( player->get_studio_hdr( ), anim_layer.sequence );
}
if ( dist * v237 <= 0.001f ) {
dist = 0.001f;
}
else {
dist *= v237;
}
player->pose_parameter( )[ 7 ] = move_yaw;
float speed = record->velocity.length( true );
float v50 = ( 1.0f - ( state->walk_run_transition * 0.15f ) ) * ( ( speed / dist ) * v56 ); // 0x11C
float new_playback_rate = interfaces::global_vars->interval_per_tick * v50;
return new_playback_rate;
};
C++:
const auto cur_left = calc_playback_rate( player, record->sim_left.layers[ 6 ].playback_rate );
const float delta_left = abs( prev_record->sim_left.layers[6].playback_rate - cur_left );