41 lines
567 B
C++
41 lines
567 B
C++
#ifndef Rectangle2D_h__
|
|
#define Rectangle2D_h__
|
|
|
|
namespace LifeGraphics
|
|
{
|
|
class Rectangle2D
|
|
{
|
|
public:
|
|
float minX;
|
|
float minY;
|
|
float maxX;
|
|
float maxY;
|
|
|
|
Rectangle2D(float _minX, float _minY, float _maxX, float _maxY)
|
|
{
|
|
minX = _minX;
|
|
maxX = _maxX;
|
|
minY = _minY;
|
|
maxY = _maxY;
|
|
}
|
|
const float width() const
|
|
{
|
|
return maxX - minX;
|
|
}
|
|
const float height() const
|
|
{
|
|
return maxY - minY;
|
|
}
|
|
Rectangle2D()
|
|
{
|
|
minX = 0.0f;
|
|
maxX = 0.0f;
|
|
minY = 0.0f;
|
|
maxY = 0.0f;
|
|
}
|
|
~Rectangle2D()
|
|
{
|
|
}
|
|
};
|
|
}
|
|
#endif // Rectangle2D_h__
|