Struct half2 | Package Manager UI website
docs.unity3d.com
    Show / Hide Table of Contents

    Struct half2

    Namespace: Unity.Mathematics
    Syntax
    public struct half2 : IEquatable<half2>, IFormattable

    Constructors

    half2(Double)

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

    Declaration
    public half2(double v)
    Parameters
    Type Name Description
    System.Double v

    half2(Single)

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

    Declaration
    public half2(float v)
    Parameters
    Type Name Description
    System.Single v

    half2(double2)

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

    Declaration
    public half2(double2 v)
    Parameters
    Type Name Description
    double2 v

    half2(float2)

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

    Declaration
    public half2(float2 v)
    Parameters
    Type Name Description
    float2 v

    half2(half)

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

    Declaration
    public half2(half v)
    Parameters
    Type Name Description
    half v

    half2(half, half)

    Constructs a half2 vector from two half values.

    Declaration
    public half2(half x, half y)
    Parameters
    Type Name Description
    half x
    half y

    half2(half2)

    Constructs a half2 vector from a half2 vector.

    Declaration
    public half2(half2 xy)
    Parameters
    Type Name Description
    half2 xy

    Fields

    x

    Declaration
    public half x
    Field Value
    Type Description
    half

    y

    Declaration
    public half y
    Field Value
    Type Description
    half

    zero

    half2 zero value.

    Declaration
    public static readonly half2 zero
    Field Value
    Type Description
    half2

    Properties

    Item[Int32]

    Returns the half element at a specified index.

    Declaration
    public half this[int index] { get; set; }
    Parameters
    Type Name Description
    System.Int32 index
    Property Value
    Type Description
    half

    xx

    Declaration
    public half2 xx { get; }
    Property Value
    Type Description
    half2

    xxx

    Declaration
    public half3 xxx { get; }
    Property Value
    Type Description
    half3

    xxxx

    Declaration
    public half4 xxxx { get; }
    Property Value
    Type Description
    half4

    xxxy

    Declaration
    public half4 xxxy { get; }
    Property Value
    Type Description
    half4

    xxy

    Declaration
    public half3 xxy { get; }
    Property Value
    Type Description
    half3

    xxyx

    Declaration
    public half4 xxyx { get; }
    Property Value
    Type Description
    half4

    xxyy

    Declaration
    public half4 xxyy { get; }
    Property Value
    Type Description
    half4

    xy

    Declaration
    public half2 xy { get; set; }
    Property Value
    Type Description
    half2

    xyx

    Declaration
    public half3 xyx { get; }
    Property Value
    Type Description
    half3

    xyxx

    Declaration
    public half4 xyxx { get; }
    Property Value
    Type Description
    half4

    xyxy

    Declaration
    public half4 xyxy { get; }
    Property Value
    Type Description
    half4

    xyy

    Declaration
    public half3 xyy { get; }
    Property Value
    Type Description
    half3

    xyyx

    Declaration
    public half4 xyyx { get; }
    Property Value
    Type Description
    half4

    xyyy

    Declaration
    public half4 xyyy { get; }
    Property Value
    Type Description
    half4

    yx

    Declaration
    public half2 yx { get; set; }
    Property Value
    Type Description
    half2

    yxx

    Declaration
    public half3 yxx { get; }
    Property Value
    Type Description
    half3

    yxxx

    Declaration
    public half4 yxxx { get; }
    Property Value
    Type Description
    half4

    yxxy

    Declaration
    public half4 yxxy { get; }
    Property Value
    Type Description
    half4

    yxy

    Declaration
    public half3 yxy { get; }
    Property Value
    Type Description
    half3

    yxyx

    Declaration
    public half4 yxyx { get; }
    Property Value
    Type Description
    half4

    yxyy

    Declaration
    public half4 yxyy { get; }
    Property Value
    Type Description
    half4

    yy

    Declaration
    public half2 yy { get; }
    Property Value
    Type Description
    half2

    yyx

    Declaration
    public half3 yyx { get; }
    Property Value
    Type Description
    half3

    yyxx

    Declaration
    public half4 yyxx { get; }
    Property Value
    Type Description
    half4

    yyxy

    Declaration
    public half4 yyxy { get; }
    Property Value
    Type Description
    half4

    yyy

    Declaration
    public half3 yyy { get; }
    Property Value
    Type Description
    half3

    yyyx

    Declaration
    public half4 yyyx { get; }
    Property Value
    Type Description
    half4

    yyyy

    Declaration
    public half4 yyyy { get; }
    Property Value
    Type Description
    half4

    Methods

    Equals(Object)

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

    Declaration
    public override bool Equals(object o)
    Parameters
    Type Name Description
    System.Object o
    Returns
    Type Description
    System.Boolean
    Overrides
    System.ValueType.Equals(System.Object)

    Equals(half2)

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

    Declaration
    public bool Equals(half2 rhs)
    Parameters
    Type Name Description
    half2 rhs
    Returns
    Type Description
    System.Boolean

    GetHashCode()

    Returns a hash code for the half2.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    System.Int32
    Overrides
    System.ValueType.GetHashCode()

    ToString()

    Returns a string representation of the half2.

    Declaration
    public override string ToString()
    Returns
    Type Description
    System.String
    Overrides
    System.ValueType.ToString()

    ToString(String, IFormatProvider)

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

    Declaration
    public string ToString(string format, IFormatProvider formatProvider)
    Parameters
    Type Name Description
    System.String format
    System.IFormatProvider formatProvider
    Returns
    Type Description
    System.String

    Operators

    Equality(half, half2)

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

    Declaration
    public static bool2 operator ==(half lhs, half2 rhs)
    Parameters
    Type Name Description
    half lhs
    half2 rhs
    Returns
    Type Description
    bool2

    Equality(half2, half)

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

    Declaration
    public static bool2 operator ==(half2 lhs, half rhs)
    Parameters
    Type Name Description
    half2 lhs
    half rhs
    Returns
    Type Description
    bool2

    Equality(half2, half2)

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

    Declaration
    public static bool2 operator ==(half2 lhs, half2 rhs)
    Parameters
    Type Name Description
    half2 lhs
    half2 rhs
    Returns
    Type Description
    bool2

    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.

    Declaration
    public static explicit operator half2(double v)
    Parameters
    Type Name Description
    System.Double v
    Returns
    Type Description
    half2

    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.

    Declaration
    public static explicit operator half2(float v)
    Parameters
    Type Name Description
    System.Single v
    Returns
    Type Description
    half2

    Explicit(double2 to half2)

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

    Declaration
    public static explicit operator half2(double2 v)
    Parameters
    Type Name Description
    double2 v
    Returns
    Type Description
    half2

    Explicit(float2 to half2)

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

    Declaration
    public static explicit operator half2(float2 v)
    Parameters
    Type Name Description
    float2 v
    Returns
    Type Description
    half2

    Implicit(half to half2)

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

    Declaration
    public static implicit operator half2(half v)
    Parameters
    Type Name Description
    half v
    Returns
    Type Description
    half2

    Inequality(half, half2)

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

    Declaration
    public static bool2 operator !=(half lhs, half2 rhs)
    Parameters
    Type Name Description
    half lhs
    half2 rhs
    Returns
    Type Description
    bool2

    Inequality(half2, half)

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

    Declaration
    public static bool2 operator !=(half2 lhs, half rhs)
    Parameters
    Type Name Description
    half2 lhs
    half rhs
    Returns
    Type Description
    bool2

    Inequality(half2, half2)

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

    Declaration
    public static bool2 operator !=(half2 lhs, half2 rhs)
    Parameters
    Type Name Description
    half2 lhs
    half2 rhs
    Returns
    Type Description
    bool2
    Back to top
    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