noise4XYZBeforeW method

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

4D OpenSimplex2F noise, with XYZ oriented like noise3Classic, and W for an extra degree of freedom. W repeats eventually.

Recommended for time-varied animations which texture a 3D object (W=time)

Implementation

@override
double noise4XYZBeforeW(double x, double y, double z, double w) {
  double xyz = x + y + z;
  double ww = w * 0.2236067977499788;
  double s2 = xyz * -0.16666666666666666 + ww;
  double xs = x + s2, ys = y + s2, zs = z + s2, ws = -0.5 * xyz + ww;

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