#pragma once #include "Vec2.h" namespace Framework { template struct Rect2 { Vec2 topLeft; Vec2 bottomRight; //! Prüft, ob sich das Rechteck mit einem anderen Überschneidet inline bool collidesWith(const Rect2& r) { return r.topLeft.x < bottomRight.x && r.bottomRight.x > topLeft.x && r.topLeft.y < bottomRight.y && r.bottomRight.y > r.topLeft.y; } }; } // namespace Framework