offset method

double offset(
  1. double min,
  2. double max, [
  3. double roughnessGain = 1
])

Generates a random offset between min and max based on roughness.

The roughnessGain parameter can be used to amplify or reduce the roughness effect for specific operations.

Implementation

double offset(double min, double max, [double roughnessGain = 1]) {
  return roughness *
      roughnessGain *
      ((randomizer.next() * (max - min)) + min);
}