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:
2025-08-25 03:09:32 -05:00
parent b775d5a90f
commit 59162408f1
15 changed files with 566 additions and 293 deletions

24
inc/camera.hpp Normal file
View 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);