#pragma once #include namespace charcoal { template struct Rectangle { Rectangle(T top, T bottom, T left, T right) : top(top), bottom(bottom), left(left), right(right) {} Rectangle(const glm::tvec2& top_left, const glm::tvec2& bottom_right) : top(top_left.y), bottom(bottom_right.y), left(top_left.x), right(bottom_right.x) {} Rectangle(const glm::tvec2& center, T width, T height) : top(center.y + height / 2.0f), bottom(center.y - height / 2.0f), left(center.x - width / 2.0f), right(center.x + width / 2.0f) {} T top; T bottom; T left; T right; }; }