Class FlawedPointHash.FNVHash

java.lang.Object
com.github.yellowstonegames.grid.IPointHash.IntImpl
com.github.yellowstonegames.grid.FlawedPointHash.FNVHash
All Implemented Interfaces:
com.github.yellowstonegames.core.IFlawed, FlawedPointHash, IPointHash
Enclosing interface:
FlawedPointHash

public static class FlawedPointHash.FNVHash extends IPointHash.IntImpl implements FlawedPointHash
FNV32a is OK as a hash for bytes when used in some hash tables, but it has major issues on its low-order bits when used as a point hash (the high bits aren't much better). Unfortunately, it is not aesthetically pleasing as a point hash. Some usages might be able to use it to apply a grimy, glitchy effect.
  • Constructor Details

    • FNVHash

      public FNVHash()
    • FNVHash

      public FNVHash(int state)
  • Method Details

    • getState

      public int getState()
    • hashWithState

      public int hashWithState(int x, int y, int state)
      Specified by:
      hashWithState in interface IPointHash
    • hashWithState

      public int hashWithState(int x, int y, int z, int state)
      Specified by:
      hashWithState in interface IPointHash
    • hashWithState

      public int hashWithState(int x, int y, int z, int w, int state)
      Specified by:
      hashWithState in interface IPointHash
    • hashWithState

      public int hashWithState(int x, int y, int z, int w, int u, int state)
      Specified by:
      hashWithState in interface IPointHash
    • hashWithState

      public int hashWithState(int x, int y, int z, int w, int u, int v, int state)
      Specified by:
      hashWithState in interface IPointHash
    • hashWithState

      public int hashWithState(int x, int y, int z, int w, int u, int v, int m, int state)
      Specified by:
      hashWithState in interface IPointHash