1use he3d_math::{Quat, Vec3};
2
3pub const DEFAULT_NEAR: f32 = 0.1;
6
7#[derive(Clone, Copy, PartialEq, Debug)]
10pub struct Camera {
11 pub position: Vec3,
12 pub orientation: Quat,
13 pub fov_y_degrees: f32,
16 pub near: f32,
19}
20
21impl Camera {
22 pub const fn new(position: Vec3, orientation: Quat, fov_y_degrees: f32) -> Self {
23 Self {
24 position,
25 orientation,
26 fov_y_degrees,
27 near: DEFAULT_NEAR,
28 }
29 }
30}
31
32impl Default for Camera {
33 fn default() -> Self {
34 Self {
35 position: Vec3::new(0.0, 0.0, 5.0),
36 orientation: Quat::IDENTITY,
37 fov_y_degrees: 90.0,
38 near: DEFAULT_NEAR,
39 }
40 }
41}