tweak: updated the way the player body adjusts fov
This commit is contained in:
parent
5bd8b88376
commit
67d59a161d
|
@ -30,9 +30,9 @@ void PlayerBody::on_child_entered(Node *node) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlayerBody::process(double delta) {
|
void PlayerBody::process(double delta) {
|
||||||
GETSETM(this->camera, fov_factor, {
|
float const target_fov{ get_is_running() ? 1.25f : 1.0f };
|
||||||
fov_factor = Math::move_toward(fov_factor, target_fov, float(delta));
|
fov = Math::move_toward(fov, target_fov, float(delta * 2.0));
|
||||||
});
|
this->camera->set_fov_factor(fov);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlayerBody::physics_process(double delta) {
|
void PlayerBody::physics_process(double delta) {
|
||||||
|
|
|
@ -36,6 +36,7 @@ private:
|
||||||
float acceleration{ 40.f };
|
float acceleration{ 40.f };
|
||||||
float jump_strength{ 4.f };
|
float jump_strength{ 4.f };
|
||||||
Vector2 movement_input{ 0, 0 };
|
Vector2 movement_input{ 0, 0 };
|
||||||
|
float fov{ 1.f };
|
||||||
|
|
||||||
PlayerCamera *camera{ nullptr };
|
PlayerCamera *camera{ nullptr };
|
||||||
WeaponInventory *weapons{ nullptr };
|
WeaponInventory *weapons{ nullptr };
|
||||||
|
|
Loading…
Reference in a new issue