Rectangle (2D axis aligned bounding box) class.
More...
#include <Rectangle.h>
List of all members.
Public Member Functions |
| Rectangle () |
| Default constructor setting all minimum and maximum components to 0.
|
| Rectangle (const Rectangle &cSource) |
| Copy constructor.
|
| Rectangle (const Vector2 &vMin, const Vector2 &vMax) |
| Constructor.
|
| Rectangle (float fMinX, float fMinY, float fMaxX, float fMaxY) |
| Constructor.
|
| ~Rectangle () |
| Destructor.
|
Rectangle & | operator= (const Rectangle &cSource) |
| Copy operator.
|
Vector2 | GetCenter () const |
| Returns the center of the rectangle.
|
float | GetX () const |
| Returns the x position.
|
float | GetY () const |
| Returns the y position.
|
float | GetWidth () const |
| Returns the width.
|
float | GetHeight () const |
| Returns the height.
|
float | CalculateSurface () const |
| Calculates the surface of the rectangle.
|
void | ClipByRectangle (const Rectangle &cEnclosed) |
| Clips this rectangle with another one.
|
void | AppendToRectangle (const Vector2 &vV) |
| Appends a vertex to the rectangle.
|
void | CombineRectangles (const Rectangle &cRectangle) |
| Combines two rectangles.
|
PLMATH_API bool | ScreenRectangle (const PLCore::Array< Vector3 > &lstPoints, bool bZCull, const Matrix4x4 &mMVP, PLCore::uint32 nX, PLCore::uint32 nY, PLCore::uint32 nWidth, PLCore::uint32 nHeight) |
| Calculates the screen-space bounding rectangle of the given array of points.
|
PLMATH_API bool | ScreenRectangle (const PLCore::Array< Vector4 > &lstPoints, bool bZCull, const Matrix4x4 &mMVP, PLCore::uint32 nX, PLCore::uint32 nY, PLCore::uint32 nWidth, PLCore::uint32 nHeight) |
| Calculates the screen-space bounding rectangle of the given array of points.
|
Public Attributes |
Vector2 | vMin |
Vector2 | vMax |
Detailed Description
Rectangle (2D axis aligned bounding box) class.
Constructor & Destructor Documentation
Default constructor setting all minimum and maximum components to 0.
Copy constructor.
- Parameters:
-
[in] | cSource | Source to copy from |
Constructor.
- Parameters:
-
[in] | vMin | Minimum position |
[in] | vMax | Maximum position |
Constructor.
- Parameters:
-
[in] | fMinX | X component of the minimum position |
[in] | fMinY | Y component of the minimum position |
[in] | fMaxX | X component of the maximum position |
[in] | fMaxY | Y component of the maximum position |
Member Function Documentation
Copy operator.
- Parameters:
-
[in] | cSource | Source to copy from |
- Returns:
- Reference to this instance
Returns the center of the rectangle.
- Returns:
- Center of the rectangle ((vMax+vMin)/2)
Returns the x position.
- Returns:
- X position
Returns the y position.
- Returns:
- Y position
Returns the width.
- Returns:
- Width
Returns the height.
- Returns:
- Height
Calculates the surface of the rectangle.
- Returns:
- Surface of the rectangle
Clips this rectangle with another one.
- Parameters:
-
[in] | cEnclosed | Rectangle to clip this rectangle with |
Appends a vertex to the rectangle.
- Parameters:
-
Combines two rectangles.
- Parameters:
-
[in] | cRectangle | Rectangle to combine with this rectangle |
Calculates the screen-space bounding rectangle of the given array of points.
- Parameters:
-
[in] | lstPoints | Array of points |
[in] | bZCull | Determines whether or not the function should also return 'false' if the rectangle lies outside the depth range |
[in] | mMVP | Concatenated modelview/projection matrix |
[in] | nX | X screen position |
[in] | nY | Y screen position |
[in] | nWidth | Screen width |
[in] | nHeight | Screen height |
- Returns:
- 'false' if the rectangle is entirely off-screen, else 'true'
Calculates the screen-space bounding rectangle of the given array of points.
- Parameters:
-
[in] | lstPoints | Array of points |
[in] | bZCull | Determines whether or not the function should also return 'false' if the rectangle lies outside the depth range |
[in] | mMVP | Concatenated modelview/projection matrix |
[in] | nX | X screen position |
[in] | nY | Y screen position |
[in] | nWidth | Screen width |
[in] | nHeight | Screen height |
- Returns:
- 'false' if the rectangle is entirely off-screen, else 'true'
Member Data Documentation
The documentation for this class was generated from the following files: