rag
graphic 2d engine
Public Member Functions | Public Attributes | List of all members
rag::Rectangle Class Reference

Represents a Rectangle. More...

#include <Rectangle.h>

Public Member Functions

 Rectangle (float x=0, float y=0, float width=0, float height=0)
 Constructor with coordinates and size.
 
Rectangle rectUnion (const Rectangle &toUnion) const
 Returns the union of the current instance with another Rectangle.
 
Rectangle intersection (const Rectangle &toIntersect) const
 Returns the intersection of the current instance with another Rectangle.
 
bool intersects (const Rectangle &toIntersect) const
 Returns true if the instance intersects with the other Rectangle.
 
bool contains (float x, float y) const
 Checks if a point lies inside the Rectangle.
 
bool contains (const glm::vec2 &point) const
 Checks if a point lies inside the Rectangle.
 
bool contains (const Rectangle &rect) const
 Checks if a Rectangle lies inside the Rectangle.
 
bool operator== (const Rectangle &other) const
 
bool operator!= (const Rectangle &other) const
 
std::string toString ()
 String representation of the Rectangle.
 

Public Attributes

float x
 
float y
 
float width
 
float height
 

Detailed Description

Represents a Rectangle.


The documentation for this class was generated from the following files: