docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct half2

    A 2 component vector of halfs.

    Implements
    IEquatable<half2>
    IFormattable
    Inherited Members
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetType()
    Namespace: Unity.Mathematics
    Assembly: solution.dll
    Syntax
    [Serializable]
    public struct half2 : IEquatable<half2>, IFormattable

    Constructors

    Name Description
    half2(double)

    Constructs a half2 vector from a single double value by converting it to half and assigning it to every component.

    half2(float)

    Constructs a half2 vector from a single float value by converting it to half and assigning it to every component.

    half2(double2)

    Constructs a half2 vector from a double2 vector by componentwise conversion.

    half2(float2)

    Constructs a half2 vector from a float2 vector by componentwise conversion.

    half2(half)

    Constructs a half2 vector from a single half value by assigning it to every component.

    half2(half, half)

    Constructs a half2 vector from two half values.

    half2(half2)

    Constructs a half2 vector from a half2 vector.

    Fields

    Name Description
    x

    x component of the vector.

    y

    y component of the vector.

    zero

    half2 zero value.

    Properties

    Name Description
    this[int]

    Returns the half element at a specified index.

    Methods

    Name Description
    Equals(object)

    Returns true if the half2 is equal to a given half2, false otherwise.

    Equals(half2)

    Returns true if the half2 is equal to a given half2, false otherwise.

    GetHashCode()

    Returns a hash code for the half2.

    ToString()

    Returns a string representation of the half2.

    ToString(string, IFormatProvider)

    Returns a string representation of the half2 using a specified format and culture-specific format information.

    Operators

    Name Description
    operator ==(half, half2)

    Returns the result of a componentwise equality operation on a half value and a half2 vector.

    operator ==(half2, half)

    Returns the result of a componentwise equality operation on a half2 vector and a half value.

    operator ==(half2, half2)

    Returns the result of a componentwise equality operation on two half2 vectors.

    explicit operator half2(double)

    Explicitly converts a single double value to a half2 vector by converting it to half and assigning it to every component.

    explicit operator half2(float)

    Explicitly converts a single float value to a half2 vector by converting it to half and assigning it to every component.

    explicit operator half2(double2)

    Explicitly converts a double2 vector to a half2 vector by componentwise conversion.

    explicit operator half2(float2)

    Explicitly converts a float2 vector to a half2 vector by componentwise conversion.

    implicit operator half2(half)

    Implicitly converts a single half value to a half2 vector by assigning it to every component.

    operator !=(half, half2)

    Returns the result of a componentwise not equal operation on a half value and a half2 vector.

    operator !=(half2, half)

    Returns the result of a componentwise not equal operation on a half2 vector and a half value.

    operator !=(half2, half2)

    Returns the result of a componentwise not equal operation on two half2 vectors.

    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)