feat: player body now handles movement fov adjustment

This commit is contained in:
Sara 2025-08-11 17:59:31 +02:00
parent b29966ccf7
commit 6c5a24e374
7 changed files with 62 additions and 43 deletions

View file

@ -23,19 +23,31 @@ void PlayerCamera::ready() {
this->base_fov = get_fov();
}
void PlayerCamera::process(double delta) {
this->fov_factor = 1.0;
update_fov();
}
void PlayerCamera::_notification(int what) {
if (Engine::get_singleton()->is_editor_hint()) {
return;
}
switch (what) {
default:
return;
case NOTIFICATION_READY:
set_process(true);
set_process_priority(-1);
ready();
return;
case NOTIFICATION_PROCESS:
process(get_process_delta_time());
return;
}
}
void PlayerCamera::set_fov_factor(float value) {
this->fov_factor = value;
this->fov_factor *= value;
update_fov();
}