diff options
| author | Schark <jordan@schark.online> | 2026-09-23 23:40:11 -0400 |
|---|---|---|
| committer | Schark <jordan@schark.online> | 2026-09-23 23:40:11 -0400 |
| commit | 23ef8bc20310bdfad52b07a3f1e4e61c98896841 (patch) | |
| tree | 007cc1d6d73ebb38d2e06422d4050f769dd65535 /platformer/src/camera.h | |
| parent | dab65412376d1b73381446f969c1461c24169811 (diff) | |
| download | gamedev-23ef8bc20310bdfad52b07a3f1e4e61c98896841.tar.gz gamedev-23ef8bc20310bdfad52b07a3f1e4e61c98896841.zip | |
Working demogit add README.md src/
Diffstat (limited to '')
| -rw-r--r-- | platformer/src/camera.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/platformer/src/camera.h b/platformer/src/camera.h index ead4bc9..cdceaec 100644 --- a/platformer/src/camera.h +++ b/platformer/src/camera.h @@ -49,4 +49,21 @@ #ifndef CAMERA_H #define CAMERA_H +#include "controls.h" +#include "math3d.h" + +typedef struct Camera { + Vec3 target; /* the smoothed point we look at (near the player) */ + float yaw; /* orbit angle around the target, radians */ + float pitch; /* angle above horizontal, radians */ + float distance; /* meters from target */ + Vec3 position; /* derived eye position (recomputed in camera_update) */ +} Camera; + +void camera_init(Camera *c, Vec3 follow_point); +void camera_update(Camera *c, const Input *in, Vec3 follow_point, float dt); +float camera_yaw(const Camera *c); +Mat4 camera_view(const Camera *c); +Mat4 camera_projection(const Camera *c, float aspect); + #endif /* CAMERA_H */ |
