1 #ifndef Rag_Rectangle_h
2 #define Rag_Rectangle_h
16 Rectangle(
float x = 0,
float y = 0,
float width = 0,
float height = 0);
28 bool contains(
float x,
float y)
const;
31 bool contains(
const glm::vec2& point)
const;
36 bool operator==(
const Rectangle &other)
const;
37 bool operator!=(
const Rectangle &other)
const;
42 float x, y, width, height;
Rectangle(float x=0, float y=0, float width=0, float height=0)
Constructor with coordinates and size.
Definition: Rectangle.cpp:8
Rectangle rectUnion(const Rectangle &toUnion) const
Returns the union of the current instance with another Rectangle.
Definition: Rectangle.cpp:16
Represents a Rectangle.
Definition: Rectangle.h:10
Rectangle intersection(const Rectangle &toIntersect) const
Returns the intersection of the current instance with another Rectangle.
Definition: Rectangle.cpp:31
bool contains(float x, float y) const
Checks if a point lies inside the Rectangle.
Definition: Rectangle.cpp:52
bool intersects(const Rectangle &toIntersect) const
Returns true if the instance intersects with the other Rectangle.
Definition: Rectangle.cpp:44
std::string toString()
String representation of the Rectangle.
Definition: Rectangle.cpp:70