use crate::*;
#[derive(Clone, Copy, Data, Debug, New, PartialEq, PartialOrd)]
pub struct Camera2D {
#[get(type(copy))]
pub(crate) position: Vector2D,
#[get(type(copy))]
pub(crate) zoom: f64,
#[get(type(copy))]
pub(crate) rotation: f64,
#[get(type(copy))]
pub(crate) viewport_width: f64,
#[get(type(copy))]
pub(crate) viewport_height: f64,
}
#[derive(Clone, Copy, Data, Debug, New, PartialEq, PartialOrd)]
pub struct Camera3D {
#[get(type(copy))]
pub(crate) position: Vector3D,
#[get(type(copy))]
pub(crate) target: Vector3D,
#[get(type(copy))]
#[new(skip)]
pub(crate) up: Vector3D,
#[get(type(copy))]
#[new(skip)]
pub(crate) fov: f64,
#[get(type(copy))]
#[new(skip)]
pub(crate) near: f64,
#[get(type(copy))]
#[new(skip)]
pub(crate) far: f64,
#[get(type(copy))]
pub(crate) viewport_width: f64,
#[get(type(copy))]
pub(crate) viewport_height: f64,
}
#[derive(Clone, Data, New)]
pub struct CanvasRenderer {
pub(crate) context: CanvasRenderingContext2d,
#[get(type(copy))]
pub(crate) camera: Camera2D,
}
#[derive(Clone, Data, New)]
pub struct SsaaCanvas {
pub(crate) display_canvas: HtmlCanvasElement,
pub(crate) display_context: CanvasRenderingContext2d,
pub(crate) offscreen_canvas: HtmlCanvasElement,
pub(crate) offscreen_context: CanvasRenderingContext2d,
#[get(type(copy))]
pub(crate) scale_factor: f64,
#[get(type(copy))]
pub(crate) width: f64,
#[get(type(copy))]
pub(crate) height: f64,
}