A serious refactor. Moved the entire window management process to another thread. Made a plotting interface with DLL exports. Refactored camera and changed transformation approach based on Jordan's suggestions
This commit is contained in:
24
inc/camera.hpp
Normal file
24
inc/camera.hpp
Normal file
@@ -0,0 +1,24 @@
|
||||
#pragma once
|
||||
|
||||
#include <glm/matrix.hpp>
|
||||
|
||||
struct Viewport {
|
||||
float fov_degrees;
|
||||
float width;
|
||||
float height;
|
||||
};
|
||||
|
||||
Viewport make_viewport(float win_w, float win_h, float fov_degrees);
|
||||
glm::mat4 camera_to_projection(Viewport& v);
|
||||
|
||||
struct Camera {
|
||||
glm::vec3 focus;
|
||||
float theta, phi, distance;
|
||||
};
|
||||
|
||||
Camera make_camera(glm::vec3 focus, float distance);
|
||||
void pan_camera(Camera &c, glm::vec2 dxdy);
|
||||
void rotate_camera(Camera &c, glm::vec2 dxdy);
|
||||
void zoom_camera(Camera &c, float dz);
|
||||
glm::mat4 world_to_camera(Camera& c);
|
||||
glm::mat4 camera_to_world(Camera& c);
|
||||
Reference in New Issue
Block a user