Class PerlinNoiseRandom
Generates random values using Perlin noise, a gradient noise function producing natural-looking random patterns.
Inheritance
Implements
Namespace: GUPS.EasyPooling.Policy.Random
Assembly: cs.temp.dll.dll
Syntax
public class PerlinNoiseRandom : IRandom
Constructors
PerlinNoiseRandom(Single)
Initializes a new instance of the PerlinNoiseRandom class.
Declaration
public PerlinNoiseRandom(float _Range)
Parameters
Type | Name | Description |
---|---|---|
System.Single | _Range | The applicable range for the noise map used to calculate random values. |
PerlinNoiseRandom(Single, Int32)
Initializes a new instance of the PerlinNoiseRandom class with the seed.
Declaration
public PerlinNoiseRandom(float _Range, int _Seed)
Parameters
Type | Name | Description |
---|---|---|
System.Single | _Range | The applicable range for the noise map used to calculate random values. |
System.Int32 | _Seed | The seed value for the random number generator. |
Methods
GetRandom()
Generates a random floating-point number using Perlin noise.
Declaration
public float GetRandom()
Returns
Type | Description |
---|---|
System.Single | Generates a random floating-point number between -1 (inclusive) and 1 (exclusive). |
GetRandom(Single, Single)
Generates a random floating-point number using Perlin noise between the specified values.
Declaration
public float GetRandom(float _MinInclusive, float _MaxExclusive)
Parameters
Type | Name | Description |
---|---|---|
System.Single | _MinInclusive | The minimum value (inclusive). |
System.Single | _MaxExclusive | The maximum value (exclusive). |
Returns
Type | Description |
---|---|
System.Single | Generates a random floating-point number between the passed min (inclusive) and max (exclusive) value. |
GetRandomVector2()
Generates a random 2D vector with components using Perlin noise.
Declaration
public Vector2 GetRandomVector2()
Returns
Type | Description |
---|---|
Vector2 | A random 2D vector with numbers between -1 (inclusive) and 1 (exclusive). |
GetRandomVector3()
Generates a random 3D vector with components using Perlin noise.
Declaration
public Vector3 GetRandomVector3()
Returns
Type | Description |
---|---|
Vector3 | A random 3D vector with numbers between -1 (inclusive) and 1 (exclusive). |