#pragma once #include "Vec2.h" namespace Framework { template struct Rect2 { Vec2< T > topLeft; Vec2< T > 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; } }; }