noise4XZBeforeYW method

  1. @override
double noise4XZBeforeYW(
  1. double x,
  2. double y,
  3. double z,
  4. double w
)
override

4D OpenSimplex2F noise, with XZ and YW forming orthogonal triangular-based planes.

Recommended for 3D terrain, where X and Z (or Y and W) are horizontal.

Implementation

@override
double noise4XZBeforeYW(double x, double y, double z, double w) {
  double s2 =
      (x + z) * -0.178275657951399372 + (y + w) * 0.215623393288842828;
  double t2 =
      (y + w) * -0.403949762580207112 + (x + z) * -0.375199083010075342;
  double xs = x + s2, ys = y + t2, zs = z + s2, ws = w + t2;

  return _noise4Base(xs, ys, zs, ws);
}