Skip to main content

euv_core/game/camera/
struct.rs

1use super::*;
2
3/// 2D game camera supporting world-to-screen projection, zoom, smooth target follow, frustum culling, and trauma screen shake.
4#[derive(Clone, Copy, Data, Debug, PartialEq)]
5pub struct Camera2D {
6    /// World-space focal center position.
7    #[get(type(copy))]
8    pub(crate) position: Point,
9    /// Uniform zoom multiplier (`1.0` = 1:1 world-to-logical-pixel).
10    #[get(type(copy))]
11    pub(crate) zoom: f32,
12    /// Current screen-shake trauma level in `[0.0, 1.0]`.
13    #[get(type(copy))]
14    pub(crate) trauma: f32,
15    /// Maximum screen-shake displacement in world units.
16    #[get(type(copy))]
17    pub(crate) max_shake: f32,
18    /// Accumulated shake phase timer in seconds.
19    #[get(type(copy))]
20    pub(crate) shake_time: f32,
21    /// Optional world clamp rectangle preventing camera overscroll past arena edges.
22    #[get(skip)]
23    pub(crate) world_bounds: Option<Rect>,
24}