diff options
| author | Schark <jordan@schark.online> | 2026-09-24 14:31:10 -0400 |
|---|---|---|
| committer | Schark <jordan@schark.online> | 2026-09-24 14:31:10 -0400 |
| commit | 077dfb2774e29cc49b9d602bb3a2f5e81e4a9a63 (patch) | |
| tree | cd590ba45d7854f2eecedcdca0c682818334d7a5 /platformer/src/camera.h | |
| parent | ddbaf66281986ed50133b7eaa92c37ef9dbb5636 (diff) | |
| download | gamedev-077dfb2774e29cc49b9d602bb3a2f5e81e4a9a63.tar.gz gamedev-077dfb2774e29cc49b9d602bb3a2f5e81e4a9a63.zip | |
Camera horizon reset
Diffstat (limited to 'platformer/src/camera.h')
| -rw-r--r-- | platformer/src/camera.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/platformer/src/camera.h b/platformer/src/camera.h index 84897d7..60134ed 100644 --- a/platformer/src/camera.h +++ b/platformer/src/camera.h @@ -27,6 +27,11 @@ * as of last tick, to detect whether they moved * bool recentering; true during the recenter glide * float recenter_yaw; where the glide is headed: behind the player + * float hands_off_time; seconds since the camera was last moved by hand + * (right stick or recenter), capped at + * 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 * } Camera; * * void camera_init(Camera *c, Vec3 follow_point); @@ -78,6 +83,8 @@ typedef struct Camera { Vec3 subject; /* last tick's framed point (feet + target height) */ bool recentering; /* gliding to "centered, behind the player" */ 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 */ } Camera; void camera_init(Camera *c, Vec3 follow_point); |
