rust/lib-hedgewars-engine/src/render/camera.rs
author alfadur
Fri, 22 Mar 2019 20:01:47 +0300
changeset 14725 12db7e435ea6
child 14726 19122a329774
permissions -rw-r--r--
move camera into engine

use integral_geometry::{Point, Rect, Size};

#[derive(Debug)]
pub struct Camera {
    pub position: Point,
    pub zoom: f32,
    size: Size
}

impl Camera {
    pub fn new() -> Self {
        Self {position: Point::ZERO, zoom: 0.0, size: Size::new(1024, 768) }
    }

    pub fn viewport(&self) -> Rect {
        Rect::from_size(self.position, self.size)
    }
}