Class AnimationCurveSampler
Returns random values according to a range and probability distribution denoted by a user provided AnimationCurve. The X axis of the AnimationCurve corresponds to the values this sampler will pick from, and the Y axis corresponds to the relative probability of the values. The relative probabilities (Y axis) do not need to max out at 1, as only the shape of the curve matters. The Y values cannot however be negative.
Implements
Inherited Members
Namespace: UnityEngine.Perception.Randomization.Samplers
Assembly: solution.dll
Syntax
[Serializable]
public class AnimationCurveSampler : ISampler
Constructors
Name | Description |
---|---|
AnimationCurveSampler() | Constructs a default AnimationCurveSampler |
AnimationCurveSampler(AnimationCurve, int) | Constructs an AnimationCurveSampler with a given animation curve |
Fields
Name | Description |
---|---|
distributionCurve | The Animation Curve associated with this sampler |
numOfSamplesForIntegration | Number of samples used for integrating over the provided AnimationCurve. The larger the number of samples, the more accurate the resulting probability distribution will be. |
Methods
Name | Description |
---|---|
Sample() | Generates one sample |
Validate() | Validates that the sampler is configured properly |