Polyphase Game Engine
Loading...
Searching...
No Matches
Rect.h
Go to the documentation of this file.
1#pragma once
2
3class Rect
4{
5public:
6
7 Rect();
8 Rect(float x, float y, float width, float height);
9
10 float mX;
11 float mY;
12 float mWidth;
13 float mHeight;
14
15 bool ContainsPoint(float x, float y) const;
16 bool OverlapsRect(const Rect& otherRect) const;
17 void Clamp(const Rect& otherRect);
18
19 float Top() const { return mY; }
20 float Bottom() const { return mY + mHeight; }
21 float Left() const { return mX; }
22 float Right() const { return mX + mWidth; }
23};
Definition Rect.h:4
float mWidth
Definition Rect.h:12
bool ContainsPoint(float x, float y) const
Definition Rect.cpp:21
float Left() const
Definition Rect.h:21
float Bottom() const
Definition Rect.h:20
float mX
Definition Rect.h:10
float mY
Definition Rect.h:11
float mHeight
Definition Rect.h:13
Rect()
Definition Rect.cpp:4
float Right() const
Definition Rect.h:22
bool OverlapsRect(const Rect &otherRect) const
Definition Rect.cpp:34
float Top() const
Definition Rect.h:19