java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.std.Mt19937
- All Implemented Interfaces:
ConstJoltPhysicsObject
,RandomNumberEngine
,AutoCloseable
,Comparable<JoltPhysicsObject>
Generate a pseudo-random sequence of integers using a 32-bit Mersenne
Twister. (native type: std::mt19937)
The algorithm isn't specific to Jolt Physics. It's included in Jolt JNI for expediency, since MutableCompoundShapeTest.h uses it.
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, va
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface com.github.stephengold.joltjni.readonly.ConstJoltPhysicsObject
close, hasAssignedNativeObject, ownsNativeObject, targetVa
-
Constructor Details
-
Mt19937
public Mt19937()Instantiate a generator. -
Mt19937
public Mt19937(int seed) Instantiate a generator using the specified 32-bit seed.- Parameters:
seed
- for initialization
-
-
Method Details
-
nextInt
public int nextInt()Return the next integer in the sequence.- Specified by:
nextInt
in interfaceRandomNumberEngine
- Returns:
- an integer value
-
seed
public void seed(int value) Seed the engine with the specified value.- Specified by:
seed
in interfaceRandomNumberEngine
- Parameters:
value
- the value to use
-