Class UniformIntDistribution
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.std.UniformIntDistribution
- All Implemented Interfaces:
ConstJoltPhysicsObject
,AutoCloseable
,Comparable<JoltPhysicsObject>
Generate uniformly distributed
int
values. (native type:
std::uniform_int_distribution<int>
)
The algorithm isn't specific to Jolt Physics. It's included in Jolt JNI for expediency, since BroadPhaseInsertionTest.cpp uses it.
-
Constructor Summary
ConstructorsConstructorDescriptionUniformIntDistribution
(int min, int max) Instantiate a uniform distribution with the specified range of output values. -
Method Summary
Modifier and TypeMethodDescriptionint
nextInt
(RandomNumberEngine generator) Iterate and return the nextint
value in the sequence.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, va
-
Constructor Details
-
UniformIntDistribution
public UniformIntDistribution(int min, int max) Instantiate a uniform distribution with the specified range of output values.- Parameters:
min
- the desired (inclusive) lower limitmax
- the desired (inclusive) upper limit
-
-
Method Details
-
nextInt
Iterate and return the nextint
value in the sequence.- Parameters:
generator
- the sequence generator to use (not null, modified)- Returns:
- the value
-