docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class ConstantSampler

    Returns a constant value when sampled

    Inheritance
    object
    ConstantSampler
    Implements
    ISampler
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.Perception.Randomization.Samplers
    Assembly: Unity.Perception.Runtime.dll
    Syntax
    [Serializable]
    public class ConstantSampler : ISampler

    Constructors

    ConstantSampler()

    Constructs a ConstantSampler

    Declaration
    public ConstantSampler()

    ConstantSampler(float, bool, float, float)

    Constructs a new ConstantSampler

    Declaration
    public ConstantSampler(float value, bool shouldCheckValidRange = false, float minAllowed = 0, float maxAllowed = 0)
    Parameters
    Type Name Description
    float value

    The value from which samples will be generated

    bool shouldCheckValidRange

    Whether the provided minAllowed and maxAllowed values should be used to validate the value provided

    float minAllowed

    The smallest min value allowed for this range

    float maxAllowed

    The largest max value allowed for this range

    Fields

    value

    The value from which samples will be generated

    Declaration
    public float value
    Field Value
    Type Description
    float

    Properties

    maxAllowed

    The largest value this sampler should output

    Declaration
    public float maxAllowed { get; set; }
    Property Value
    Type Description
    float

    minAllowed

    The smallest value this sampler should output

    Declaration
    public float minAllowed { get; set; }
    Property Value
    Type Description
    float

    shouldCheckValidRange

    Whether the provided minAllowed and maxAllowed values should be used to validate this sampler.

    Declaration
    public bool shouldCheckValidRange { get; set; }
    Property Value
    Type Description
    bool

    Methods

    CheckAgainstValidRange()

    Checks if range valid

    Declaration
    public void CheckAgainstValidRange()

    Sample()

    Generates one sample

    Declaration
    public float Sample()
    Returns
    Type Description
    float

    The generated sample

    Validate()

    Validates that the sampler is configured properly

    Declaration
    public void Validate()

    Implements

    ISampler
    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)