2023-05-02 11:02:43 +00:00
|
|
|
#ifndef ENGINE_TEST_SRC_CAMERA_CONTROLLER_H_
|
|
|
|
#define ENGINE_TEST_SRC_CAMERA_CONTROLLER_H_
|
2022-11-07 20:15:26 +00:00
|
|
|
|
2023-05-02 11:02:43 +00:00
|
|
|
#include <glm/vec3.hpp>
|
2023-02-09 15:21:37 +00:00
|
|
|
|
2023-05-01 13:13:35 +00:00
|
|
|
#include "components/transform.h"
|
2023-05-02 11:02:43 +00:00
|
|
|
#include "ecs_system.h"
|
2022-11-07 20:15:26 +00:00
|
|
|
|
2023-01-05 13:21:33 +00:00
|
|
|
struct CameraControllerComponent {
|
2023-05-02 11:02:43 +00:00
|
|
|
static constexpr float kWalkSpeed = 4.0f;
|
|
|
|
static constexpr float kCameraSensitivity = 0.007f;
|
|
|
|
float yaw = 0.0f;
|
|
|
|
float pitch = 0.0f;
|
2023-01-05 13:21:33 +00:00
|
|
|
};
|
|
|
|
|
2023-05-02 11:02:43 +00:00
|
|
|
class CameraControllerSystem
|
2023-07-04 16:08:28 +00:00
|
|
|
: public engine::System {
|
2023-05-02 11:02:43 +00:00
|
|
|
public:
|
|
|
|
CameraControllerSystem(engine::Scene* scene);
|
2022-11-07 20:15:26 +00:00
|
|
|
|
2023-05-02 11:02:43 +00:00
|
|
|
// engine::System overrides
|
|
|
|
void OnUpdate(float ts) override;
|
2023-02-09 15:21:37 +00:00
|
|
|
|
2023-05-02 11:02:43 +00:00
|
|
|
engine::TransformComponent* t = nullptr;
|
|
|
|
CameraControllerComponent* c = nullptr;
|
2022-11-07 20:15:26 +00:00
|
|
|
};
|
2023-05-02 11:02:43 +00:00
|
|
|
|
|
|
|
#endif
|