You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
629 B

4 months ago
#pragma once
#include <glm/mat4x4.hpp>
#include <glm/gtc/quaternion.hpp>
#include <vulkan/vulkan_core.h>
#include "input.hpp"
class Camera : private MouseListener {
private:
4 months ago
glm::vec3 position {0, 0, 5};
4 months ago
float velocityMultiplier = 0;
4 months ago
float phi = 0;
float theta = 0;
float fov = 45;
float near = 0.1;
float far = 100;
3 months ago
VkExtent2D &extent;
4 months ago
public:
3 months ago
explicit Camera(VkExtent2D &extent);
4 months ago
void update(float dt);
glm::mat4 view() const;
glm::mat4 projection() const;
glm::vec2 viewport() const;
3 months ago
glm::vec3 localToWorld(const glm::vec3 &direction) const;
4 months ago
protected:
void mouseMoved(const glm::vec2 &delta) override;
4 months ago
};