Class UniformFloatDistribution

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

public class UniformFloatDistribution 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 BroadPhaseInsertionTest.cpp uses it.

  • Constructor Details

    • UniformFloatDistribution

      public UniformFloatDistribution(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(RandomNumberEngine generator)
      Iterate and return the next float value in the sequence.
      Parameters:
      generator - the sequence generator to use (not null, modified)
      Returns:
      the value