use crate::geometry::Point2d; use crate::geometry::Vec2d; #[derive(Debug, Default, Clone, Copy, PartialEq)] pub struct Rectangle { pub pos: Point2d, pub size: Vec2d, } impl Rectangle { pub fn new(x: T, y: T, w: T, h: T) -> Rectangle { Rectangle { pos: Point2d::new(x, y), size: Vec2d::new(w, h), } } // TODO: Constructor to build a rectangle centered at an x,y }