struct TDistribution

template<class T>
Inherits: IScriptExportable

Specifies a value as a distribution, which can include a constant value, random range or a curve.

Public

Constructors

TDistribution<T>

Creates a new empty distribution.

TDistribution<T>

TDistribution<T>(T value)

Creates a new distribution that returns a constant value.

TDistribution<T>

TDistribution<T>(T minValue, T maxValue)

Creates a new distribution that returns a random value in the specified range.

TDistribution<T>

TDistribution<T>(const TAnimationCurve<T> &curve)

Creates a new distribution that evaluates a curve.

TDistribution<T>

TDistribution<T>(const TAnimationCurve<T> &minCurve, const TAnimationCurve<T> &maxCurve)

Creates a new distribution that returns a random value in a range determined by two curves.

TDistribution

TDistribution()

Creates a new empty distribution.

TDistribution

TDistribution(float value)

Creates a new distribution that returns a constant value.

TDistribution

TDistribution(float minValue, float maxValue)

Creates a new distribution that returns a random value in the specified range.

TDistribution

TDistribution(const TAnimationCurve<float> &curve)

Creates a new distribution that evaluates a curve.

TDistribution

TDistribution(const TAnimationCurve<float> &minCurve, const TAnimationCurve<float> &maxCurve)

Creates a new distribution that returns a random value in a range determined by two curves.

TDistribution

TDistribution()

Creates a new empty distribution.

TDistribution

TDistribution(TVector3<float> value)

Creates a new distribution that returns a constant value.

TDistribution

TDistribution(TVector3<float> minValue, TVector3<float> maxValue)

Creates a new distribution that returns a random value in the specified range.

TDistribution

TDistribution(const TAnimationCurve<TVector3<float>> &curve)

Creates a new distribution that evaluates a curve.

TDistribution

TDistribution(const TAnimationCurve<TVector3<float>> &minCurve, const TAnimationCurve<TVector3<float>> &maxCurve)

Creates a new distribution that returns a random value in a range determined by two curves.

TDistribution

TDistribution()

Creates a new empty distribution.

TDistribution

TDistribution(TVector2<float> value)

Creates a new distribution that returns a constant value.

TDistribution

TDistribution(TVector2<float> minValue, TVector2<float> maxValue)

Creates a new distribution that returns a random value in the specified range.

TDistribution

TDistribution(const TAnimationCurve<TVector2<float>> &curve)

Creates a new distribution that evaluates a curve.

TDistribution

TDistribution(const TAnimationCurve<TVector2<float>> &minCurve, const TAnimationCurve<TVector2<float>> &maxCurve)

Creates a new distribution that returns a random value in a range determined by two curves.

Methods

GetType

PropertyDistributionType GetType() const

Returns the type of the represented distribution.

GetMinConstant

const T &GetMinConstant() const

Returns the constant value of the distribution, or the minimal value of a constant range.

Undefined if the distribution is represented by a curve.

GetMaxConstant

const T &GetMaxConstant() const

Returns the maximum value of a constant range.

Only defined if the distribution represents a non-curve range.

GetMinCurve

const TAnimationCurve<T> &GetMinCurve() const

Returns the curve representing the distribution, or the first curve representing a curve range.

Undefined if the distribution is represented by a constant or a non-curve range.

GetMaxCurve

const TAnimationCurve<T> &GetMaxCurve() const

Returns the curve representing the second curve of a curve range.

Only defined if the distribution represents a curve range.

Evaluate

T Evaluate(float t, float factor) const

Evaluates the value of the distribution.

t
Time at which to evaluate the distribution. This is only relevant if the distribution contains curves.
factor
Value in range [0, 1] that determines how to interpolate between min/max value, if the distribution represents a range. Value of 0 will return the minimum value, while value of 1 will return the maximum value, and interpolate the values in-between.

Returns: Evaluated value.

Evaluate

T Evaluate(float t, const Random &factor) const

Evaluates the value of the distribution.

t
Time at which to evaluate the distribution. This is only relevant if the distribution contains curves.
factor
Random number generator that determines the factor. Factor determines how to interpolate between min/max value, if the distribution represents a range.

Returns: Evaluated value.

ToLookupTable

LookupTable ToLookupTable(u32 numSamples = 128, bool ignoreRange = false) const

Converts the distribution into a lookup table that's faster to access.

The distribution will be resampled using a fixed sample rate with equidistant samples.

numSamples
Determines how many samples to output in the lookup table. This value is ignored for non-curve distributions in which case there is always just one sample.
ignoreRange
If the curve represents a range (either between constants or curves), this determines should the other value of the range be included in the lookup table. If true, only the minimum constant/curve will be included, and if false then the maximum curve values will follow the minimum curve values of each sample.

Returns: Resampled lookup table.

GetType

PropertyDistributionType GetType() const

Returns the type of the represented distribution.

GetMinConstant

const float &GetMinConstant() const

Returns the constant value of the distribution, or the minimal value of a constant range.

Undefined if the distribution is represented by a curve.

GetMaxConstant

const float &GetMaxConstant() const

Returns the maximum value of a constant range.

Only defined if the distribution represents a non-curve range.

GetMinCurve

const TAnimationCurve<float> &GetMinCurve() const

Returns the curve representing the distribution, or the first curve representing a curve range.

Undefined if the distribution is represented by a constant or a non-curve range.

GetMaxCurve

const TAnimationCurve<float> &GetMaxCurve() const

Returns the curve representing the second curve of a curve range.

Only defined if the distribution represents a curve range.

Evaluate

float Evaluate(float t, float factor) const

Evaluates the value of the distribution.

t
Time at which to evaluate the distribution. This is only relevant if the distribution contains curves.
factor
Value in range [0, 1] that determines how to interpolate between min/max value, if the distribution represents a range. Value of 0 will return the minimum value, while value of 1 will return the maximum value, and interpolate the values in-between.

Returns: Evaluated value.

Evaluate

float Evaluate(float t, const Random &factor) const

Evaluates the value of the distribution.

t
Time at which to evaluate the distribution. This is only relevant if the distribution contains curves.
factor
Random number generator that determines the factor. Factor determines how to interpolate between min/max value, if the distribution represents a range.

Returns: Evaluated value.

ToLookupTable

LookupTable ToLookupTable(u32 numSamples, bool ignoreRange) const

Converts the distribution into a lookup table that's faster to access.

The distribution will be resampled using a fixed sample rate with equidistant samples.

numSamples
Determines how many samples to output in the lookup table. This value is ignored for non-curve distributions in which case there is always just one sample.
ignoreRange
If the curve represents a range (either between constants or curves), this determines should the other value of the range be included in the lookup table. If true, only the minimum constant/curve will be included, and if false then the maximum curve values will follow the minimum curve values of each sample.

Returns: Resampled lookup table.

GetType

PropertyDistributionType GetType() const

Returns the type of the represented distribution.

GetMinConstant

const TVector3<float> &GetMinConstant() const

Returns the constant value of the distribution, or the minimal value of a constant range.

Undefined if the distribution is represented by a curve.

GetMaxConstant

const TVector3<float> &GetMaxConstant() const

Returns the maximum value of a constant range.

Only defined if the distribution represents a non-curve range.

GetMinCurve

const TAnimationCurve<TVector3<float>> &GetMinCurve() const

Returns the curve representing the distribution, or the first curve representing a curve range.

Undefined if the distribution is represented by a constant or a non-curve range.

GetMaxCurve

const TAnimationCurve<TVector3<float>> &GetMaxCurve() const

Returns the curve representing the second curve of a curve range.

Only defined if the distribution represents a curve range.

Evaluate

TVector3<float> Evaluate(float t, float factor) const

Evaluates the value of the distribution.

t
Time at which to evaluate the distribution. This is only relevant if the distribution contains curves.
factor
Value in range [0, 1] that determines how to interpolate between min/max value, if the distribution represents a range. Value of 0 will return the minimum value, while value of 1 will return the maximum value, and interpolate the values in-between.

Returns: Evaluated value.

Evaluate

TVector3<float> Evaluate(float t, const Random &factor) const

Evaluates the value of the distribution.

t
Time at which to evaluate the distribution. This is only relevant if the distribution contains curves.
factor
Random number generator that determines the factor. Factor determines how to interpolate between min/max value, if the distribution represents a range.

Returns: Evaluated value.

ToLookupTable

LookupTable ToLookupTable(u32 numSamples, bool ignoreRange) const

Converts the distribution into a lookup table that's faster to access.

The distribution will be resampled using a fixed sample rate with equidistant samples.

numSamples
Determines how many samples to output in the lookup table. This value is ignored for non-curve distributions in which case there is always just one sample.
ignoreRange
If the curve represents a range (either between constants or curves), this determines should the other value of the range be included in the lookup table. If true, only the minimum constant/curve will be included, and if false then the maximum curve values will follow the minimum curve values of each sample.

Returns: Resampled lookup table.

GetType

PropertyDistributionType GetType() const

Returns the type of the represented distribution.

GetMinConstant

const TVector2<float> &GetMinConstant() const

Returns the constant value of the distribution, or the minimal value of a constant range.

Undefined if the distribution is represented by a curve.

GetMaxConstant

const TVector2<float> &GetMaxConstant() const

Returns the maximum value of a constant range.

Only defined if the distribution represents a non-curve range.

GetMinCurve

const TAnimationCurve<TVector2<float>> &GetMinCurve() const

Returns the curve representing the distribution, or the first curve representing a curve range.

Undefined if the distribution is represented by a constant or a non-curve range.

GetMaxCurve

const TAnimationCurve<TVector2<float>> &GetMaxCurve() const

Returns the curve representing the second curve of a curve range.

Only defined if the distribution represents a curve range.

Evaluate

TVector2<float> Evaluate(float t, float factor) const

Evaluates the value of the distribution.

t
Time at which to evaluate the distribution. This is only relevant if the distribution contains curves.
factor
Value in range [0, 1] that determines how to interpolate between min/max value, if the distribution represents a range. Value of 0 will return the minimum value, while value of 1 will return the maximum value, and interpolate the values in-between.

Returns: Evaluated value.

Evaluate

TVector2<float> Evaluate(float t, const Random &factor) const

Evaluates the value of the distribution.

t
Time at which to evaluate the distribution. This is only relevant if the distribution contains curves.
factor
Random number generator that determines the factor. Factor determines how to interpolate between min/max value, if the distribution represents a range.

Returns: Evaluated value.

ToLookupTable

LookupTable ToLookupTable(u32 numSamples, bool ignoreRange) const

Converts the distribution into a lookup table that's faster to access.

The distribution will be resampled using a fixed sample rate with equidistant samples.

numSamples
Determines how many samples to output in the lookup table. This value is ignored for non-curve distributions in which case there is always just one sample.
ignoreRange
If the curve represents a range (either between constants or curves), this determines should the other value of the range be included in the lookup table. If true, only the minimum constant/curve will be included, and if false then the maximum curve values will follow the minimum curve values of each sample.

Returns: Resampled lookup table.

Operators

operator==

bool operator==(const TDistribution<T> &rhs) const

operator!=

bool operator!=(const TDistribution<T> &rhs) const

operator==

bool operator==(const TDistribution<float> &rhs) const

operator!=

bool operator!=(const TDistribution<float> &rhs) const

operator==

bool operator==(const TDistribution<TVector3<float>> &rhs) const

operator!=

bool operator!=(const TDistribution<TVector3<float>> &rhs) const

operator==

bool operator==(const TDistribution<TVector2<float>> &rhs) const

operator!=

bool operator!=(const TDistribution<TVector2<float>> &rhs) const

Private

Fields

mMinCurve

TAnimationCurve<T> mMinCurve

mMaxCurve

TAnimationCurve<T> mMaxCurve

mMinCurve

TAnimationCurve<float> mMinCurve

mMaxCurve

TAnimationCurve<float> mMaxCurve

mMinCurve

TAnimationCurve<TVector3<float>> mMinCurve

mMaxCurve

TAnimationCurve<TVector3<float>> mMaxCurve

mMinCurve

TAnimationCurve<TVector2<float>> mMinCurve

mMaxCurve

TAnimationCurve<TVector2<float>> mMaxCurve