summaryrefslogtreecommitdiff
path: root/engine/src/camera.rs
blob: 46b7293b47cabe2ff87ce4e6e1c8e93ed5e5e9b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
use ecs::Component;

use crate::projection::{Perspective, Projection};
use crate::vector::Vec3;

pub mod fly;

#[derive(Debug, Component)]
pub struct Camera
{
    pub target: Vec3<f32>,
    pub global_up: Vec3<f32>,
    pub current: bool,
    pub projection: Projection,
}

impl Default for Camera
{
    fn default() -> Self
    {
        Self {
            target: Vec3::default(),
            global_up: Vec3::UP,
            current: false,
            projection: Projection::Perspective(Perspective::default()),
        }
    }
}