neon-sprawl/client/scripts/camera_state.gd

34 lines
1.8 KiB
GDScript
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

extends RefCounted
## Client-local **per-frame** snapshot from the follow rig (`isometric_follow_camera.gd`).
## The rig creates **one** instance and assigns fields every `_process` after pose is final.
## No `class_name` — see repo Godot headless / CI notes.
##
## **Consumer contract (NEON-28):** Risk UX / HUD may read this object from the rigs
## `camera_state` getter. **Policy-style data** (occlusion enabled,
## zoom resource identity, pitch, presentation compass) is **not** duplicated here — read the
## rigs exports (`allow_yaw`, `presentation_yaw_deg`, resources) when needed. Future E6.M2 work
## may promote selected flags into this type; until then, keep a single source on the rig.
##
## **Authority:** Camera pose is client-only; the server must not use it for gameplay checks
## (`docs/decomposition/modules/client_server_authority.md` — E1.M2).
## Orbit yaw (rad) around the follow target **vertical axis**, **relative to** the rigs fixed
## presentation compass (`presentation_yaw_deg` on `isometric_follow_camera.gd`).
## **Not** total camera compass — only the optional orbit delta. Prototype UX keeps this at **0**
## (`allow_yaw` false). If orbit is enabled mid-project, HUD and world-anchored gameplay should
## treat framing as presentation + this delta (see E1.M2 rotation policy).
var yaw: float = 0.0
## Scene path to the follow anchor (typically `CharacterBody3D` / `Node3D`).
var follow_target_path: NodePath = NodePath()
## Effective follow distance used for framing this tick (meters) — active zoom band or fallback.
var distance: float = 0.0
## Active discrete zoom band index when the rig uses a zoom-band resource; otherwise **0**.
var zoom_band_index: int = 0
## World-space point the rig used as look-at focus last tick.
var focus_world: Vector3 = Vector3.ZERO