|
proto external void | SetSeed (int seed) |
|
proto external vector | GenerateRandomPoint (array< float > polygon, vector bbMin, vector bbMax) |
| Generates random point in given polygon.
|
|
proto external vector | GenerateRandomPointInRadius (float minRadius, float maxRadius, vector center, bool uniform=true) |
| Generates a random point around center in range min/max radius.
|
|
proto external float | RandFloat01 () |
| Generates random float in [0, 1] range.
|
|
proto external float | RandFloatXY (float x, float y) |
| Generates random float in [X, Y] range.
|
|
proto external float | RandGaussFloat (float sigma, float mean) |
| Returns random number with Gauss distribution (http://en.wikipedia.org/wiki/File:Normal_Distribution_PDF.svg)
|
|
proto external int | RandInt (int min, int max) |
| Returns a random int number between and min [inclusive] and max [exclusive].
|
|
proto external int | RandIntInclusive (int min, int max) |
| Returns a random int number between and min [inclusive] and max [inclusive].
|
|
proto external ref Managed | Clone () |
| Return shallow copy of object, or null if it is not allowed (not public constructor)
|
|
◆ GenerateRandomPoint()
Generates random point in given polygon.
- Parameters
-
polygon | Consecutive floats give polygon in 2D (2 floats = Vector2) |
bbMin | Bounding box minimum corner |
bbMax | Bounding box maximum corner |
- Returns
- Vector3 point in polygon
◆ GenerateRandomPointInRadius()
proto external vector RandomGenerator.GenerateRandomPointInRadius |
( |
float |
minRadius, |
|
|
float |
maxRadius, |
|
|
vector |
center, |
|
|
bool |
uniform = true |
|
) |
| |
Generates a random point around center
in range min/max radius.
- Parameters
-
minRadius | All generated points will be at least this far from center |
maxRadius | All generated points will be at most this far from center |
center | Position around which to generate. Vector2 XZ |
uniform | If false, has a small bias towards the center which may be desirable in some situations |
- Returns
- Vector2 XZ set, Y = 0
◆ RandFloat01()
proto external float RandomGenerator.RandFloat01 |
( |
| ) |
|
Generates random float in [0, 1] range.
◆ RandFloatXY()
Generates random float in [X, Y] range.
- Parameters
-
x | float Range starts[inclusive] |
y | float Range ends[inclusive] |
◆ RandGaussFloat()
proto external float RandomGenerator.RandGaussFloat |
( |
float |
sigma, |
|
|
float |
mean |
|
) |
| |
◆ RandInt()
proto external int RandomGenerator.RandInt |
( |
int |
min, |
|
|
int |
max |
|
) |
| |
Returns a random int
number between and min [inclusive] and max [exclusive].
- Parameters
-
min | int Range starts [inclusive] |
max | int Range ends [exclusive] |
- Returns
int
- Random number in range
>> 0
>> 1
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
Definition: RandomGenerator.c:13
proto external int RandInt(int min, int max)
Returns a random int number between and min [inclusive] and max [exclusive].
◆ RandIntInclusive()
proto external int RandomGenerator.RandIntInclusive |
( |
int |
min, |
|
|
int |
max |
|
) |
| |
Returns a random int
number between and min [inclusive] and max [inclusive].
- Parameters
-
min | int Range starts [inclusive] |
max | int Range ends [inclusive] |
- Returns
int
- Random number in range
>> 1
>> 2
proto external int RandIntInclusive(int min, int max)
Returns a random int number between and min [inclusive] and max [inclusive].
◆ SetSeed()
proto external void RandomGenerator.SetSeed |
( |
int |
seed | ) |
|
The documentation for this interface was generated from the following file:
- Core/generated/System/RandomGenerator.c