summaryrefslogtreecommitdiff
path: root/engine/src/camera.rs
blob: 1bae5bb2f4c4ef9d383b21285a3f40605fc13b4b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use crate::vector::Vec3;

pub trait Camera
{
    /// Returns the current camera position.
    fn position(&self) -> Vec3<f32>;

    /// Returns the position of the camera target.
    fn target(&self) -> Vec3<f32>;

    /// Returns the global direction upwards.
    ///
    /// The default implementation which returns [`Vec3::UP`] should be fine in most
    /// cases.
    fn up(&self) -> Vec3<f32>
    {
        Vec3::UP
    }
}