Class UniformRealDistribution

java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.UniformRealDistribution
All Implemented Interfaces:
ConstJoltPhysicsObject, AutoCloseable, Comparable<ConstJoltPhysicsObject>

public class UniformRealDistribution extends JoltPhysicsObject
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 Details

    • UniformRealDistribution

      public UniformRealDistribution(float min, float max)
      Instantiate a uniform distribution with the specified range of output values.
      Parameters:
      min - the desired lower limit
      max - the desired upper limit
  • Method Details

    • nextFloat

      public float nextFloat(DefaultRandomEngine generator)
      Iterate and return the next float value in the sequence.
      Parameters:
      generator - the sequence generator to use (not null)
      Returns:
      the value
    • nextFloat

      public float nextFloat(Mt19937 generator)
      Iterate and return the next float value in the sequence.
      Parameters:
      generator - the sequence generator to use (not null)
      Returns:
      the value