-
Автор темы
- #1
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
чет не оч мне нравиться что от первого личика 200 фпс а от третьего личика 40)
что где нужно поменять что бы фпс был нормальным?
Thirdperson code:
void c_visuals::on_override_view( valve::view_setup_t* const setup ) {
static bool keep_height{};
if ( !valve::g_engine->in_game( ) ) {
keep_height = false;
return;
}
if ( m_cfg->m_effects.m_fov_changer ) {
setup->m_fov = 90.f + m_cfg->m_effects.m_fov;
if ( m_cfg->m_effects.m_viewmodel_fov_changer )
setup->m_view_model_fov = ( 60.f - m_cfg->m_effects.m_fov ) + m_cfg->m_effects.m_viewmodel_fov;
}
else if ( m_cfg->m_effects.m_viewmodel_fov_changer )
setup->m_view_model_fov = 60.f + m_cfg->m_effects.m_viewmodel_fov;
if ( valve::g_local_player->alive( ) ) {
if ( g_movement->should_fake_duck( ) ) {
keep_height = true;
setup->m_origin.z = valve::g_local_player->get_abs_origin( ).z + 64.0625f;
}
else if ( keep_height ) {
const auto& local_data = g_eng_pred->local_data( ).at( g_ctx->last_cmd_number( ) % 150 );
if ( local_data.m_net_vars.m_duck_amount != local_data.m_pred_net_vars.m_duck_amount ) {
if ( local_data.m_pred_net_vars.m_duck_amount > 0.05f )
setup->m_origin.z = valve::g_local_player->get_abs_origin( ).z + 64.0625f;
else
keep_height = false;
}
else
keep_height = false;
}
float distance = m_cfg->m_effects.m_thirdperson_distance;
vec3_t angles = valve::g_engine->view_angles( );
vec3_t inverse_angles = valve::g_engine->view_angles( );
inverse_angles.z = ( distance + 32.f );
vec3_t forward, right, up;
math::angle_vectors( inverse_angles, &forward, &right, &up );
valve::trace_t trace;
valve::trace_filter_simple_t trace_filter{ valve::g_local_player, 0 };
auto eye_pos = valve::g_local_player->get_abs_origin( ) + valve::g_local_player->view_offset( );
auto offset = eye_pos + forward * -( distance + 32.f ) + right + up;
valve::ray_t ray( eye_pos, offset );
valve::g_engine_trace->trace_ray( ray, valve::e_mask::shot_hull, reinterpret_cast< valve::trace_filter_t* >( &trace_filter ), &trace );
angles.z = distance * trace.m_fraction;
valve::g_input->m_camera_in_third_person = m_cfg->m_effects.m_force_thirdperson_alive
&& m_cfg->m_effects.m_force_thirdperson_key && LOWORD( GetKeyState( m_cfg->m_effects.m_force_thirdperson_key ) );
valve::g_input->m_camera_offset = angles;
}
else {
keep_height = false;
if ( m_cfg->m_effects.m_force_thirdperson_dead
&& valve::g_local_player->observer_mode( ) == 4 ) {
valve::g_local_player->observer_mode( ) = 5;
valve::g_input->m_camera_in_third_person = false;
}
}
}