summaryrefslogtreecommitdiffstats
path: root/third_party/rust/metal/examples/raytracing/camera.rs
blob: 5548445c0667e0bea0196b0ba03ca0d528bcb24b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use glam::f32::Vec4;

#[repr(C)]
pub struct Camera {
    pub position: Vec4,
    pub right: Vec4,
    pub up: Vec4,
    pub forward: Vec4,
}

impl Camera {
    pub fn new() -> Self {
        Self {
            position: Vec4::new(0.0, 3.0, 10.0, 0.0),
            right: Vec4::new(1.0, 0.0, 0.0, 0.0),
            up: Vec4::new(0.0, 1.0, 0.0, 0.0),
            forward: Vec4::new(0.0, 0.0, -1.0, 0.0),
        }
    }
}