docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct Math.FloatRange

    Range of possible values for some constrained parameter.

    Implements
    IEquatable<Math.FloatRange>
    Inherited Members
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: Unity.Physics
    Assembly: Unity.Physics.dll
    Syntax
    public struct Math.FloatRange : IEquatable<Math.FloatRange>

    Constructors

    FloatRange(float, float)

    Constructor.

    Declaration
    public FloatRange(float min, float max)
    Parameters
    Type Name Description
    float min

    The minimum.

    float max

    The maximum.

    Fields

    Max

    The maximum.

    Declaration
    public float Max
    Field Value
    Type Description
    float

    Min

    The minimum.

    Declaration
    public float Min
    Field Value
    Type Description
    float

    Properties

    Mid

    Gets the middle.

    Declaration
    public float Mid { get; }
    Property Value
    Type Description
    float

    The middle.

    Methods

    Equals(object)

    Tests if this object is considered equal to another.

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    object obj

    The object to compare to this object.

    Returns
    Type Description
    bool

    True if the objects are considered equal, false if they are not.

    Overrides
    ValueType.Equals(object)

    Equals(FloatRange)

    Tests if this FloatRange is considered equal to another.

    Declaration
    public bool Equals(Math.FloatRange other)
    Parameters
    Type Name Description
    Math.FloatRange other

    The float range to compare to this object.

    Returns
    Type Description
    bool

    True if the objects are considered equal, false if they are not.

    GetHashCode()

    Calculates a hash code for this object.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int

    A hash code for this object.

    Overrides
    ValueType.GetHashCode()

    Sorted()

    Returns a sorted copy of this instance.

    Declaration
    public Math.FloatRange Sorted()
    Returns
    Type Description
    Math.FloatRange

    A copy of this instance, where Min is the lesser of Min and Max , and Max is the greater of the two.

    ToString()

    Convert this object into a string representation.

    Declaration
    public override string ToString()
    Returns
    Type Description
    string

    A string that represents this object.

    Overrides
    ValueType.ToString()

    Operators

    implicit operator FloatRange(float2)

    Implicit cast that converts the given float2 to a FloatRange.

    Declaration
    public static implicit operator Math.FloatRange(float2 f)
    Parameters
    Type Name Description
    float2 f

    A float2 to process.

    Returns
    Type Description
    Math.FloatRange

    The result of the operation.

    implicit operator float2(FloatRange)

    Implicit cast that converts the given FloatRange to a float2.

    Declaration
    public static implicit operator float2(Math.FloatRange range)
    Parameters
    Type Name Description
    Math.FloatRange range

    The range.

    Returns
    Type Description
    float2

    The result of the operation.

    Implements

    IEquatable<T>
    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)