|
static void | Get2DPolygon (notnull array< vector > points3D, out notnull array< float > points2D) |
| Get 2D points array from vector array, format { x1,y1, x2,y2, x3,y3 }.
|
|
static void | Get3DPolygon (notnull array< float > points2D, out notnull array< vector > points3D) |
| Get an array of vectors from 2D array with 0 for Y value.
|
|
static bool | GetMinMaxPolygon (notnull array< float > polygon, out float minX, out float maxX, out float minY, out float maxY) |
|
static float | GetPolygonArea (notnull array< float > polygon) |
| Get provided polygon's area.
|
|
static bool | GetRandomPointInPolygon (notnull array< float > polygon, out float x, out float y) |
| Get a random point within the provided 2D polygon.
|
|
static bool | GetRandomPointInRectangle (float minX, float maxX, float minY, float maxY, out float x, out float y) |
| Get a random point in the provided rectangle.
|
|
static bool | GetRandomPointInSector (float originX, float originY, float angleFrom, float angleTo, float radius, out float x, out float y) |
| Get a random point in the provided circular sector - uniform distribution.
|
|
static bool | IsPolygonValid (notnull array< float > polygon) |
| Checks the amount of points for a 2D polygon (needs 3 points to make a polygon and an even amount of values to have valid points)
|
|
static bool | PolarToCartesian (float angle, float radius, out float x, out float y) |
| Translates polar coordinates (angle and radius) into cartesian (x,y)
|
|
static vector | GenerateRandomPoint (array< float > polygon, vector bbMin, vector bbMax) |
| Generates random point in given polygon.
|
|
static vector | GenerateRandomPointInRadius (float minRadius, float maxRadius, vector center, bool uniform=true) |
| Generates a random point around center in range min/max radius.
|
|
SCR_Math2D Class.
Contains various scripted 2D math functions