A simple rectangle class.
More...
|
| Rectangle () |
| Initializes a new instance of the Rectangle class.
|
|
| Rectangle (Rectangle other) |
|
| Rectangle (float x, float y, float width, float height) |
| Initializes a new instance of the Rectangle class with predefined bounds.
|
|
void | Resize (float dx, float dy) |
| Update bounds.
|
|
void | Expand (Point p) |
| Expand rectangle to include given point.
|
|
void | Expand (IEnumerable< Point > points) |
| Expand rectangle to include a list of points.
|
|
void | Expand (Rectangle other) |
| Expand rectangle to include given rectangle.
|
|
bool | Contains (float x, float y) |
| Check if given point is inside rectangle.
|
|
bool | Contains (Point pt) |
| Check if given point is inside rectangle.
|
|
bool | Contains (Rectangle other) |
| Check if this rectangle contains other rectangle.
|
|
bool | Intersects (Rectangle other) |
| Check if this rectangle intersects other rectangle.
|
|
|
float | Left [get] |
| Gets the minimum x value (left boundary).
|
|
float | Right [get] |
| Gets the maximum x value (right boundary).
|
|
float | Bottom [get] |
| Gets the minimum y value (bottom boundary).
|
|
float | Top [get] |
| Gets the maximum y value (top boundary).
|
|
float | Width [get] |
| Gets the width of the rectangle.
|
|
float | Height [get] |
| Gets the height of the rectangle.
|
|
A simple rectangle class.
◆ Rectangle()
TriangleNet.Geometry.Rectangle.Rectangle |
( |
float |
x, |
|
|
float |
y, |
|
|
float |
width, |
|
|
float |
height |
|
) |
| |
|
inline |
Initializes a new instance of the Rectangle class with predefined bounds.
- Parameters
-
x | Minimum x value (left). |
y | Minimum y value (bottom). |
width | Width of the rectangle. |
height | Height of the rectangle. |
◆ Contains() [1/3]
bool TriangleNet.Geometry.Rectangle.Contains |
( |
float |
x, |
|
|
float |
y |
|
) |
| |
|
inline |
Check if given point is inside rectangle.
- Parameters
-
x | Point to check. |
y | Point to check. |
- Returns
- Return true, if rectangle contains given point.
◆ Contains() [2/3]
bool TriangleNet.Geometry.Rectangle.Contains |
( |
Point |
pt | ) |
|
|
inline |
Check if given point is inside rectangle.
- Parameters
-
- Returns
- Return true, if rectangle contains given point.
◆ Contains() [3/3]
bool TriangleNet.Geometry.Rectangle.Contains |
( |
Rectangle |
other | ) |
|
|
inline |
Check if this rectangle contains other rectangle.
- Parameters
-
- Returns
- Return true, if this rectangle contains given rectangle.
◆ Expand() [1/2]
void TriangleNet.Geometry.Rectangle.Expand |
( |
Point |
p | ) |
|
|
inline |
Expand rectangle to include given point.
- Parameters
-
◆ Expand() [2/2]
void TriangleNet.Geometry.Rectangle.Expand |
( |
Rectangle |
other | ) |
|
|
inline |
Expand rectangle to include given rectangle.
- Parameters
-
x | X coordinate. |
y | Y coordinate. |
◆ Intersects()
bool TriangleNet.Geometry.Rectangle.Intersects |
( |
Rectangle |
other | ) |
|
|
inline |
Check if this rectangle intersects other rectangle.
- Parameters
-
- Returns
- Return true, if given rectangle intersects this rectangle.
◆ Resize()
void TriangleNet.Geometry.Rectangle.Resize |
( |
float |
dx, |
|
|
float |
dy |
|
) |
| |
|
inline |
Update bounds.
- Parameters
-
dx | Add dx to left and right bounds. |
dy | Add dy to top and bottom bounds. |
The documentation for this class was generated from the following file:
- C:/Transhuman/S2/Assets/Plugins/TriangleNet/Scripts/Source/Geometry/Rectangle.cs