Package com.github.stephengold.joltjni
Class UniformRealDistribution
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.UniformRealDistribution
- All Implemented Interfaces:
ConstJoltPhysicsObject,AutoCloseable,Comparable<ConstJoltPhysicsObject>
Generate uniformly distributed
float values. (native type:
std::uniform_real_distribution<float>)
The algorithm isn't specific to Jolt Physics; it's included in jolt-jni for expediency, since RagdollScene.h uses it.
-
Constructor Summary
ConstructorsConstructorDescriptionUniformRealDistribution(float min, float max) Instantiate a uniform distribution with the specified range of output values. -
Method Summary
Modifier and TypeMethodDescriptionfloatnextFloat(DefaultRandomEngine generator) Iterate and return the nextfloatvalue in the sequence.floatIterate and return the nextfloatvalue in the sequence.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, hasAssignedNativeObject, hashCode, ownsNativeObject, setVirtualAddress, startCleaner, toString, va
-
Constructor Details
-
UniformRealDistribution
public UniformRealDistribution(float min, float max) Instantiate a uniform distribution with the specified range of output values.- Parameters:
min- the desired lower limitmax- the desired upper limit
-
-
Method Details
-
nextFloat
Iterate and return the nextfloatvalue in the sequence.- Parameters:
generator- the sequence generator to use (not null)- Returns:
- the value
-
nextFloat
Iterate and return the nextfloatvalue in the sequence.- Parameters:
generator- the sequence generator to use (not null)- Returns:
- the value
-