break-utopia/modules/break_utopia/player_camera.h

35 lines
788 B
C++

#pragma once
#include "core/math/color.h"
#include "macros.h"
#include "scene/3d/camera_3d.h"
#include "scene/resources/environment.h"
class PlayerCamera : public Camera3D {
GDCLASS(PlayerCamera, Camera3D);
static void _bind_methods();
void end_effect();
void process(double delta);
protected:
void _notification(int what);
public:
static PlayerCamera *get_instance();
Ref<SceneTreeTimer> impact_effect(Color color, float freeze_time = 0.1, float zoom = 1.f, float shake_intensity = 2.f);
private:
static PlayerCamera *instance;
Color ambient_light_color{};
Ref<Environment> active_environment{};
float max_shake{ 1.f };
int active_effects{ 0 };
float active_shake{};
Vector3 shake_offset{};
double shake_interval{ 0.0 };
public:
GET_SET_FNS(float, max_shake);
};