feat: implemented camera bob and weapon bob and lead

This commit is contained in:
Sara 2025-08-29 22:56:35 +02:00
parent eea0d85ff7
commit dc65707ff1
2 changed files with 24 additions and 4 deletions

View file

@ -8,6 +8,7 @@ class PlayerCamera : public Camera3D {
GDCLASS(PlayerCamera, Camera3D);
static void _bind_methods();
void on_look_input(Vector2 input);
void lead_weapon(Vector2 movement);
void update_fov();
void update_offset();
void ready();
@ -31,6 +32,10 @@ private:
double run_bob_time{ 0.0 };
double run_bob_amplitude{ 0.025 };
double run_bob_frequency{ 10.0 };
double run_bob_blend_out{ 0.2 };
double weapon_lead_limit{ Math::PI * 0.0075 };
double weapon_lead_speed{ 0.15 };
Vector3 weapon_lead_rotation{ 0, 0, 0 };
};
#endif // !PLAYER_CAMERA_H