Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- File: AA_Rectangle.h
- Author: *REDACTED*
- Created: *REDACTED*
- Desc: File containing the class definition for Axis Aligned Rectangles (AA_Rectangle),
- capable of testing whether a point exists within the rectangle,
- as well as whether the rectangle intersects of overlaps with another rectangle
- */
- #pragma once
- #include "Point2D.h"
- class AA_Rectangle
- {
- public:
- // Default constructor
- AA_Rectangle();
- // Parameterized constructor(s)
- AA_Rectangle(Point2D * origin, float width, float height);
- AA_Rectangle(float xOrigin, float yOrigin, float width, float height);
- // Copy constructor
- AA_Rectangle(const AA_Rectangle& other);
- // Assignment operator
- void operator=(const AA_Rectangle & other);
- // Destructor
- ~AA_Rectangle();
- // Check if a given reference point lies within the rectangle
- bool isPointInRectangle(Point2D *refPoint);
- // Check if a given reference AA_Rectangle intersects this rectangle
- bool isRectangleIntersecting(AA_Rectangle *refRectangle);
- Point2D *mBottomLeft;
- Point2D *mTopRight;
- float mWidth;
- float mHeight;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement