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.
 
 
 
 

28 lines
572 B

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