OmegaEngine API
1.0.3
|
A 2D polygon consisting of four points. More...
Public Member Functions | |
Quadrangle (Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4) | |
Creates a new quadrangle. Counter-clockwise ordering is recommended. More... | |
Quadrangle (float p1X, float p1Y, float p2X, float p2Y, float p3X, float p3Y, float p4X, float p4Y) | |
Creates a new quadrangle. Counter-clockwise ordering is recommended. More... | |
Quadrangle (RectangleF rectangle) | |
Creates a new quadrangle from a simple rectangle. More... | |
Quadrangle | Offset (Vector2 distance) |
Returns a new Quadrangle shifted by distance . More... | |
Quadrangle | Rotate (float rotation) |
Returns a new Quadrangle rotated by rotation around the origin. More... | |
bool | IntersectWith (Vector2 point) |
If the points are stored counter-clockwise and form a convex polygon, this will test if a point lies inside it. More... | |
bool | IntersectWith (RectangleF rectangle) |
If the points are stored counter-clockwise and form a convex polygon, this will test if a rectangle lies inside it. More... | |
bool | IntersectWith (Quadrangle quadrangle) |
This will test if two quadrangles intersect with each other. Only works if both quadrangles are counter-clockwise and form a convex polygon. More... | |
bool | IntersectCircle (float radius) |
If the points are stored counter-clockwise and form a convex polygon, this will test if a circle with the origin (0;0) lies inside it. More... | |
override string | ToString () |
bool | Equals (Quadrangle other) |
override bool | Equals (object obj) |
override int | GetHashCode () |
Static Public Member Functions | |
static bool | operator== (Quadrangle left, Quadrangle right) |
static bool | operator != (Quadrangle left, Quadrangle right) |
Public Attributes | |
Vector2Ray | Edge1 => new Vector2Ray(P1, P2 - P1) |
The edge from P1 to P2. More... | |
Vector2Ray | Edge2 => new Vector2Ray(P2, P3 - P2) |
The edge from P2 to P3. More... | |
Vector2Ray | Edge3 => new Vector2Ray(P3, P4 - P3) |
The edge from P3 to P4. More... | |
Vector2Ray | Edge4 => new Vector2Ray(P4, P1 - P4) |
The edge from P4 to P1. More... | |
Properties | |
Vector2 | P1 [get] |
The coordinates of the first point; counter-clockwise ordering recommended. More... | |
Vector2 | P2 [get] |
The coordinates of the second point; counter-clockwise ordering recommended. More... | |
Vector2 | P3 [get] |
The coordinates of the third point; counter-clockwise ordering recommended. More... | |
Vector2 | P4 [get] |
The coordinates of the fourth point; counter-clockwise ordering recommended. More... | |
A 2D polygon consisting of four points.
|
inline |
Creates a new quadrangle. Counter-clockwise ordering is recommended.
|
inline |
Creates a new quadrangle. Counter-clockwise ordering is recommended.
|
inline |
Creates a new quadrangle from a simple rectangle.
|
inline |
If the points are stored counter-clockwise and form a convex polygon, this will test if a circle with the origin (0;0) lies inside it.
radius | The rectangle to test for intersection. |
true
if the circle lies within the quadrangle.
|
inline |
If the points are stored counter-clockwise and form a convex polygon, this will test if a point lies inside it.
point | The point to test for intersection. |
true
if point lies within the quadrangle.
|
inline |
If the points are stored counter-clockwise and form a convex polygon, this will test if a rectangle lies inside it.
rectangle | The rectangle to test for intersection. |
true
if rectangle lies within the quadrangle.bool OmegaEngine.Values.Quadrangle.IntersectWith | ( | Quadrangle | quadrangle | ) |
This will test if two quadrangles intersect with each other. Only works if both quadrangles are counter-clockwise and form a convex polygon.
quadrangle | The other quadrangle to test for intersection. |
true
if quadrangle intersects with this quadrangle.Quadrangle OmegaEngine.Values.Quadrangle.Offset | ( | Vector2 | distance | ) |
Returns a new Quadrangle shifted by distance .
distance | This value is added to each corner position. |
Quadrangle OmegaEngine.Values.Quadrangle.Rotate | ( | float | rotation | ) |
Returns a new Quadrangle rotated by rotation around the origin.
rotation | The angle to rotate by in degrees. |
Vector2Ray OmegaEngine.Values.Quadrangle.Edge1 => new Vector2Ray(P1, P2 - P1) |
Vector2Ray OmegaEngine.Values.Quadrangle.Edge2 => new Vector2Ray(P2, P3 - P2) |
Vector2Ray OmegaEngine.Values.Quadrangle.Edge3 => new Vector2Ray(P3, P4 - P3) |
Vector2Ray OmegaEngine.Values.Quadrangle.Edge4 => new Vector2Ray(P4, P1 - P4) |
|
get |
The coordinates of the first point; counter-clockwise ordering recommended.
|
get |
The coordinates of the second point; counter-clockwise ordering recommended.
|
get |
The coordinates of the third point; counter-clockwise ordering recommended.
|
get |
The coordinates of the fourth point; counter-clockwise ordering recommended.