Contents
Class HexCellDistanceFunction.SquirrelHash
java.lang.Object
com.hypixel.hytale.procedurallib.logic.cell.HexCellDistanceFunction.SquirrelHash
- Enclosing class:
HexCellDistanceFunction
Hash function adapted from:
https://youtu.be/LWFzPP8ZbdU?t=2799
This hash function benchmarks a decent amount faster than the standard HashUtils.rehash method. The speedup is helpful for hex noise as it needs to calculate a few extra cell hashes per invocation.
Benchmark Mode Cnt Score Error Units CellHashFunctionBenchmark.nothing avgt 3 26.224 ± 1.252 ns/op CellHashFunctionBenchmark.rehash avgt 3 46.358 ± 1.068 ns/op CellHashFunctionBenchmark.squirrelHash avgt 3 29.681 ± 1.019 ns/op
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
SquirrelHash
public SquirrelHash()
-
-
Method Details
-
hash
public static int hash(int seed, int x, int y)
-