feat: add working shapes
This commit is contained in:
@@ -46,6 +46,7 @@ public:
|
||||
void setCenterX(float x) { m_Center.setX(x); }
|
||||
void setCenterY(float y) { m_Center.setY(y); }
|
||||
|
||||
void setSize(float width, float height) { setWidth(width); setHeight(height); }
|
||||
void setWidth(float width) { m_Width = width; }
|
||||
void setHeight(float height) { m_Height = height; }
|
||||
|
||||
@@ -59,11 +60,21 @@ private:
|
||||
Point m_Center;
|
||||
float m_Radius;
|
||||
public:
|
||||
Circle(float x, float y, float radius) : m_Center(x, y), m_Radius(radius) {}
|
||||
Circle() : m_Radius(0) {}
|
||||
|
||||
const Point& getCenter() const { return m_Center; }
|
||||
float getCenterX() const { return m_Center.getX(); }
|
||||
float getCenterY() const { return m_Center.getY(); }
|
||||
|
||||
float getRadius() const { return m_Radius; }
|
||||
|
||||
void setCenter(const Point& center) { m_Center = center; }
|
||||
void setCenterX(float x) { m_Center.setX(x); }
|
||||
void setCenterY(float y) { m_Center.setY(y); }
|
||||
|
||||
void setRadius(float radius) { m_Radius = radius; }
|
||||
|
||||
bool collidesWith(const Point& point) const;
|
||||
bool collidesWith(const Rectangle& rect) const;
|
||||
bool collidesWith(const Circle& circle) const;
|
||||
|
||||
Reference in New Issue
Block a user