rustyray_sys/camera.rs
1use crate::math::Vector2;
2
3#[repr(C)]
4#[derive(Debug, Clone, Copy)]
5pub struct Camera2D {
6 pub offset: Vector2, // Camera offset (displacement from target)
7 pub target: Vector2, // Camera target (rotation and zoom origin)
8 pub rotation: f32, // Camera rotation in degrees
9 pub zoom: f32, // Camera zoom (scaling), should be 1.0f by default
10}
11
12impl Default for Camera2D {
13 fn default() -> Self {
14 Self {
15 offset: Vector2 { x: 0.0, y: 0.0 },
16 target: Vector2 { x: 0.0, y: 0.0 },
17 rotation: 0.0,
18 zoom: 1.0,
19 }
20 }
21}