Class Permutation

java.lang.Object
jme3utilities.math.noise.Permutation

public class Permutation extends Object
Cyclic permutation of the integers from 0 to length-1, for use in noise functions.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Permutation(int length, long seed)
    Construct a permutation with the specified length from a specified seed.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    permute(int index)
    Permute an index, wrapping at the end of the table.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Permutation

      public Permutation(int length, long seed)
      Construct a permutation with the specified length from a specified seed.
      Parameters:
      length - length of the permutation (>1)
      seed - seed for generating pseudo-random numbers
  • Method Details

    • permute

      public int permute(int index)
      Permute an index, wrapping at the end of the table.
      Parameters:
      index - input
      Returns:
      (<length, ≥0)