Package com.github.stephengold.joltjni
Class DefaultRandomEngine
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.DefaultRandomEngine
- All Implemented Interfaces:
ConstJoltPhysicsObject,AutoCloseable,Comparable<ConstJoltPhysicsObject>
Generate a pseudo-random sequence of integers for casual use. (native type:
std::default_random_engine)
The algorithm isn't specific to Jolt Physics; it's included in jolt-jni for expediency, since BroadPhaseTest.cpp uses it.
-
Constructor Summary
ConstructorsConstructorDescriptionInstantiate a generator.DefaultRandomEngine(int seed) Instantiate a generator using the specified 32-bit seed. -
Method Summary
Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, hasAssignedNativeObject, hashCode, ownsNativeObject, setVirtualAddress, startCleaner, toString, va
-
Constructor Details
-
DefaultRandomEngine
public DefaultRandomEngine()Instantiate a generator. -
DefaultRandomEngine
public DefaultRandomEngine(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.- Returns:
- an integer value
-