Class DefaultRandomEngine

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

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