noise2XBeforeY method

  1. @override
double noise2XBeforeY(
  1. double x,
  2. double y
)
override

2D Simplex noise, with Y pointing down the main diagonal.

Might be better for a 2D sandbox style game, where Y is vertical. Probably slightly less optimal for heightmaps or continent maps.

Implementation

@override
double noise2XBeforeY(double x, double y) {
  // Skew transform and rotation baked into one.
  final xx = x * 0.7071067811865476;
  final yy = y * 1.224744871380249;

  return _noise2Base(yy + xx, yy - xx);
}