diff options
| author | Schark <jordan@schark.online> | 2026-09-29 22:28:37 -0400 |
|---|---|---|
| committer | Schark <jordan@schark.online> | 2026-09-29 22:28:37 -0400 |
| commit | fdc8c951fc72d9dc4c8faa58a21b2b9de0599698 (patch) | |
| tree | edd9934a43429508acb9ec37da71eb172dc788e9 /platformer/src/camera.h | |
| parent | adb6a882870464490a8026aed1f66b21b0e72477 (diff) | |
| download | gamedev-fdc8c951fc72d9dc4c8faa58a21b2b9de0599698.tar.gz gamedev-fdc8c951fc72d9dc4c8faa58a21b2b9de0599698.zip | |
Implemented no-panning zones
Diffstat (limited to '')
| -rw-r--r-- | platformer/src/camera.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/platformer/src/camera.h b/platformer/src/camera.h index 60134ed..7dc2cc1 100644 --- a/platformer/src/camera.h +++ b/platformer/src/camera.h @@ -36,10 +36,13 @@ * * void camera_init(Camera *c, Vec3 follow_point); * void camera_update(Camera *c, const Input *in, Vec3 follow_point, - * float follow_facing, float aspect, float dt); + * float follow_facing, bool pan_locked, float aspect, float dt); * follow_point = the player's feet position; the camera adds * CAMERA_TARGET_HEIGHT itself. follow_facing = the player's - * facing_yaw, used by recenter to swing behind them. aspect = + * facing_yaw, used by recenter to swing behind them. pan_locked = + * the player is in a locked-pan zone (main.c asks the world): the + * camera doesn't swing toward the back quarter on its own (the + * stick, recenter, framing and auto-tilt all still work). aspect = * framebuffer width/height, needed because the framing zone is * defined in screen space. * float camera_yaw(const Camera *c); @@ -89,7 +92,7 @@ typedef struct Camera { void camera_init(Camera *c, Vec3 follow_point); void camera_update(Camera *c, const Input *in, Vec3 follow_point, float follow_facing, - float aspect, float dt); + bool pan_locked, float aspect, float dt); float camera_yaw(const Camera *c); Mat4 camera_view(const Camera *c); Mat4 camera_projection(const Camera *c, float aspect); |
