summaryrefslogtreecommitdiff
path: root/platformer/src/camera.h
diff options
context:
space:
mode:
authorSchark <jordan@schark.online>2026-09-29 23:36:45 -0400
committerSchark <jordan@schark.online>2026-09-29 23:36:45 -0400
commit8af1210d45c3fa3f41a174d2906ab597dcc22f1c (patch)
tree43f1a9814faae852af943f71de53d4ca38dc6cd2 /platformer/src/camera.h
parentfdc8c951fc72d9dc4c8faa58a21b2b9de0599698 (diff)
downloadgamedev-master.tar.gz
gamedev-master.zip
Final state of the game day 3HEADmaster
Diffstat (limited to '')
-rw-r--r--platformer/src/camera.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/platformer/src/camera.h b/platformer/src/camera.h
index 7dc2cc1..eeafe6c 100644
--- a/platformer/src/camera.h
+++ b/platformer/src/camera.h
@@ -32,6 +32,11 @@
* CAMERA_AUTO_PITCH_DELAY; drives the auto-pitch
* float auto_pitch_speed; current auto-pitch speed, rad/s (>= 0), so the
* tilt can ease in and out instead of moving linearly
+ * float eye_distance; how far the eye really is from the player along
+ * its line of sight (shorter than wanted when an
+ * object is in the way)
+ * bool pulled_in; an object pulled the eye in and it's easing back
+ * float return_speed; m/s of that ease back out
* } Camera;
*
* void camera_init(Camera *c, Vec3 follow_point);
@@ -61,8 +66,9 @@
*
* CONVENTIONS: Include guard: CAMERA_H.
*
- * NOT IN SCOPE: Collision with geometry, automatic "behind the player"
- * rotation, cutscene/fixed cameras, zoom levels.
+ * NOT IN SCOPE: Automatic "behind the player" rotation, cutscene/fixed
+ * cameras, zoom levels. (The eye does stay out of objects: see
+ * camera.c step 7.)
*
* DONE WHEN: player.c and render.c can be written against this header alone.
* ============================================================
@@ -88,6 +94,9 @@ typedef struct Camera {
float recenter_yaw; /* the yaw that glide is headed for */
float hands_off_time; /* s since the camera was last moved by hand (capped) */
float auto_pitch_speed; /* current auto-pitch speed, rad/s (>= 0), for easing */
+ float eye_distance; /* how far the eye actually is from the player along its line of sight */
+ bool pulled_in; /* an object pulled the eye in; it's easing back out */
+ float return_speed; /* current speed of that ease back out, m/s */
} Camera;
void camera_init(Camera *c, Vec3 follow_point);