Method | Description | |
---|---|---|
boundsFromPolygonPoints ( Vector2 points ) : |
given the points of a polygon calculates the bounds
|
|
calculateBounds ( |
||
clone ( this rect ) : |
clones and returns a new Rectangle with the same data as the current rectangle
|
|
collisionCheck ( |
returns true if the boxes are colliding moveX and moveY will return the movement that b1 must move to avoid the collision
|
|
contract ( |
||
expandSide ( |
||
fromFloats ( float x, float y, float width, float height ) : |
returns a rectangle from the passed in floats
|
|
fromMinMaxPoints ( Point min, Point max ) : |
creates a Rectangle given min/max points (top-left, bottom-right points)
|
|
getCenter ( |
gets the center point of the rectangle as a Vector2
|
|
getCenter ( this rect ) : Vector2 |
gets the center point of the rectangle as a Vector2
|
|
getClosestPointOnBoundsToOrigin ( |
||
getClosestPointOnRectangleBorderToPoint ( |
gets the closest point that is on the rectangle border to the given point
|
|
getClosestPointOnRectangleToPoint ( |
returns the closest point that is in or on the Rectangle to the given point
|
|
getHalfRect ( this rect, System.Edge edge ) : |
||
getHalfSize ( this rect ) : Vector2 |
gets the half size of the rect
|
|
getIntersectionDepth ( |
Calculates the signed depth of intersection between two rectangles.
|
|
getMax ( |
gets the max point of the rectangle, the bottom-right corner
|
|
getPosition ( |
gets the position of the rectangle as a Vector2
|
|
getRectEdgePortion ( this rect, System.Edge edge, int size = 1 ) : |
gets a portion of the Rectangle with a width/height of size that is on the Edge of the Rectangle but still contained within it.
|
|
getSide ( this rect, System.Edge edge ) : int |
gets the position of the specified side
|
|
getSweptBroadphaseBounds ( |
returns a Bounds the spans the current bounds and the provided delta positions
|
|
getSweptBroadphaseBounds ( |
returns a Bounds the spans the current bounds and the provided delta positions
|
|
intersect ( |
returns true if rect1 intersects rect2
|
|
rayIntersects ( |
||
rayIntersects ( this rectangle, Microsoft.Xna.Framework.Ray ray ) : float? | ||
scale ( |
scales the rect
|
|
translate ( |
||
union ( |
Update first to be the union of first and point
|
|
union ( |
calculates the union of the two Rectangles. The result will be a rectangle that encompasses the other two.
|
public static boundsFromPolygonPoints ( Vector2 points ) : |
||
points | Vector2 | Points. |
return |
public static calculateBounds ( |
||
rect | ||
parentPosition | Vector2 | |
position | Vector2 | |
origin | Vector2 | |
scale | Vector2 | |
rotation | float | |
width | float | |
height | float | |
return | void |
public static clone ( this rect ) : |
||
rect | this | Rect. |
return |
public static collisionCheck ( |
||
rect | ||
other | Other. | |
moveX | float | Move x. |
moveY | float | Move y. |
return | bool |
public static contract ( |
||
rect | ||
horizontalAmount | int | |
verticalAmount | int | |
return | void |
public static expandSide ( |
||
rect | ||
edge | System.Edge | |
amount | int | |
return | void |
public static fromFloats ( float x, float y, float width, float height ) : |
||
x | float | The x coordinate. |
y | float | The y coordinate. |
width | float | Width. |
height | float | Height. |
return |
public static fromMinMaxPoints ( Point min, Point max ) : |
||
min | Point | Minimum. |
max | Point | Max. |
return |
public static getCenter ( |
||
rect | Rect. | |
return | Vector2 |
public static getCenter ( this rect ) : Vector2 | ||
rect | this | Rect. |
return | Vector2 |
public static getClosestPointOnBoundsToOrigin ( |
||
rect | ||
return | Vector2 |
public static getClosestPointOnRectangleBorderToPoint ( |
||
rect | Rect. | |
point | Vector2 | Point. |
return | Point |
public static getClosestPointOnRectangleToPoint ( |
||
rect | Rect. | |
point | Vector2 | Point. |
return | Vector2 |
public static getHalfRect ( this rect, System.Edge edge ) : |
||
rect | this | |
edge | System.Edge | |
return |
public static getHalfSize ( this rect ) : Vector2 | ||
rect | this | Rect. |
return | Vector2 |
public static getIntersectionDepth ( |
||
rectA | ||
rectB | ||
return | Vector2 |
public static getMax ( |
||
rect | Rect. | |
return | Point |
public static getPosition ( |
||
rect | Rect. | |
return | Vector2 |
public static getRectEdgePortion ( this rect, System.Edge edge, int size = 1 ) : |
||
rect | this | Rect. |
edge | System.Edge | Edge. |
size | int | Size. |
return |
public static getSide ( this rect, System.Edge edge ) : int | ||
rect | this | |
edge | System.Edge | Side. |
return | int |
public static getSweptBroadphaseBounds ( |
||
rect | ||
deltaX | float | |
deltaY | float | |
return |
public static getSweptBroadphaseBounds ( |
||
rect | ||
deltaX | int | |
deltaY | int | |
return |
public static intersect ( |
||
rect1 | ||
rect2 | ||
return | bool |
public static rayIntersects ( |
||
rect | ||
ray | ||
distance | float | |
return | bool |
public static rayIntersects ( this rectangle, Microsoft.Xna.Framework.Ray ray ) : float? | ||
rectangle | this | |
ray | Microsoft.Xna.Framework.Ray | |
return | float? |
public static scale ( |
||
rect | Rect. | |
scale | Vector2 | Scale. |
return | void |
public static translate ( |
||
rect | ||
vec | Vector2 | |
return | void |
public static union ( |
||
first | First. | |
point | Point | Point. |
result | Result. | |
return | void |
public static union ( |
||
value1 | ||
value2 | ||
result | Result. | |
return | void |