public class Generator
extends java.util.Random
| Constructor and Description |
|---|
Generator()
Instantiate a pseudo-random generator with a seed likely to be unique.
|
Generator(long seed)
Instantiate a pseudo-random generator with the specified seed.
|
| Modifier and Type | Method and Description |
|---|---|
float |
nextFloat(float e1,
float e2)
Generate a single-precision value, uniformly distributed between 2
extremes.
|
int |
nextInt(int e1,
int e2)
Generate an integer value, uniformly distributed between 2 extremes.
|
Quaternion |
nextQuaternion(Quaternion storeResult)
Generate a uniformly distributed, pseudo-random unit quaternion.
|
Vector3f |
nextUnitVector3f(Vector3f storeResult)
Generate a uniformly distributed, pseudo-random unit vector.
|
Vector3f |
nextVector3f(Vector3f storeResult)
Generate a pseudo-random vector that is uniformly distributed throughout
the unit sphere centered on the origin.
|
<E> E |
pick(E[] array)
Pick a pseudo-random element from the specified array.
|
public Generator()
public Generator(long seed)
seed - initial value for the seedpublic float nextFloat(float e1,
float e2)
e1 - the first extremee2 - the 2nd extremepublic int nextInt(int e1,
int e2)
e1 - the first extremee2 - the 2nd extremepublic Quaternion nextQuaternion(Quaternion storeResult)
storeResult - storage for the result (modified if not null)public Vector3f nextUnitVector3f(Vector3f storeResult)
storeResult - storage for the result (modified if not null)public Vector3f nextVector3f(Vector3f storeResult)
storeResult - storage for the result (modified if not null)public <E> E pick(E[] array)
E - the type of list elementsarray - the array to select from (not null, may be empty)