docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class SamplerUtility

    A set of utility functions for defining sampler interfaces

    Inheritance
    object
    SamplerUtility
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: UnityEngine.Perception.Randomization.Samplers
    Assembly: solution.dll
    Syntax
    public static class SamplerUtility

    Fields

    Name Description
    largePrime

    A large prime number

    samplingBatchSize

    The number of samples to generate per job batch in an IJobParallelForBatch job

    Methods

    Name Description
    AnimationCurveSample(float[], float, float, float, float)

    Generate samples from probability distribution derived from a given AnimationCurve.

    GenerateRandomSeed()

    Non-deterministically generates a non-zero random seed

    GetSamplerDisplayName(Type)

    Returns the sampler's display name

    Hash32(uint)

    Hashes using constants generated from a program that maximizes the avalanche effect, independence of output bit changes, and the probability of a change in each output bit if any input bit is changed. Source: https://github.com/h2database/h2database/blob/master/h2/src/test/org/h2/test/store/CalculateHashConstant.java

    Hash32NonZero(uint)

    Generates a 32-bit non-zero hash using an unsigned integer seed

    Hash64(ulong)

    Based on splitmix64: http://xorshift.di.unimi.it/splitmix64.c

    IntegrateCurve(float[], AnimationCurve)

    Numerically integrate a given AnimationCurve using the specified number of samples. Based on https://en.wikipedia.org/wiki/Numerical_integration and http://blog.s-schoener.com/2018-05-05-animation-curves/ Using the trapezoidal rule for numerical interpolation

    IterateSeed(uint, uint)

    Generates new a new non-zero random state by deterministically hashing a base seed with an iteration index

    TruncatedNormalSample(float, float, float, float, float)

    Generates samples from a truncated normal distribution. Further reading about this distribution can be found here: https://en.wikipedia.org/wiki/Truncated_normal_distribution

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)