Class PoissonDiskSampling
Utility for generating lists of poisson disk sampled points
Namespace: UnityEngine.Perception.Randomization.Randomizers.Utilities
Syntax
public static class PoissonDiskSampling : object
Methods
GenerateSamples(Single, Single, Single, UInt32, Int32, Allocator)
Returns a list of poisson disc sampled points for a given area and density
Declaration
public static NativeList<float2> GenerateSamples(float width, float height, float minimumRadius, uint seed = null, int samplingResolution = null, Allocator allocator = null)
Parameters
Type | Name | Description |
---|---|---|
Single | width | Width of the sampling area |
Single | height | Height of the sampling area |
Single | minimumRadius | The minimum distance required between each sampled point |
UInt32 | seed | The random seed used to initialize the algorithm state |
Int32 | samplingResolution | The number of potential points sampled around every valid point |
Allocator | allocator | The allocator to use for the samples container |
Returns
Type | Description |
---|---|
NativeList<float2> | The list of generated poisson points |