hash3D function

int hash3D(
  1. int seed,
  2. int x,
  3. int y,
  4. int z,
)

Implementation

@pragma('vm:prefer-inline')
int hash3D(int seed, int x, int y, int z) {
  IntX hash = Int32(seed);
  hash ^= _xPrime * x;
  hash ^= _yPrime * y;
  hash ^= _zPrime * z;

  hash = hash * hash * hash * 60493;
  hash = (hash >> 13) ^ hash;

  return hash.toInt();
}