int hash3D(int seed, int x, int y, int z) { int hash = seed; hash ^= X_PRIME * x; hash ^= Y_PRIME * y; hash ^= Z_PRIME * z; hash = hash * hash * hash * 60493; hash = (hash >> 13) ^ hash; return hash; }