docs.unity3d.com
    Show / Hide Table of Contents

    Struct half2

    A 2 component vector of halfs.

    Namespace: Unity.Mathematics
    Syntax
    public struct half2 : System.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(Single)

    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
    Item[Int32]

    Returns the half element at a specified index.

    xx

    Swizzles the vector.

    xxx

    Swizzles the vector.

    xxxx

    Swizzles the vector.

    xxxy

    Swizzles the vector.

    xxy

    Swizzles the vector.

    xxyx

    Swizzles the vector.

    xxyy

    Swizzles the vector.

    xy

    Swizzles the vector.

    xyx

    Swizzles the vector.

    xyxx

    Swizzles the vector.

    xyxy

    Swizzles the vector.

    xyy

    Swizzles the vector.

    xyyx

    Swizzles the vector.

    xyyy

    Swizzles the vector.

    yx

    Swizzles the vector.

    yxx

    Swizzles the vector.

    yxxx

    Swizzles the vector.

    yxxy

    Swizzles the vector.

    yxy

    Swizzles the vector.

    yxyx

    Swizzles the vector.

    yxyy

    Swizzles the vector.

    yy

    Swizzles the vector.

    yyx

    Swizzles the vector.

    yyxx

    Swizzles the vector.

    yyxy

    Swizzles the vector.

    yyy

    Swizzles the vector.

    yyyx

    Swizzles the vector.

    yyyy

    Swizzles the vector.

    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
    Equality(half, half2)

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

    Equality(half2, half)

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

    Equality(half2, half2)

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

    Explicit(Double to half2)

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

    Explicit(Single to half2)

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

    Explicit(double2 to half2)

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

    Explicit(float2 to half2)

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

    Implicit(half to half2)

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

    Inequality(half, half2)

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

    Inequality(half2, half)

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

    Inequality(half2, half2)

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

    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023