Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


half2

A 2 component vector of halfs.
Read time 2 minutesLast updated 4 days ago

Definition

public struct half2 : IEquatable<half2>, IFormattable

Fields

Value

Description

xx component of the vector.
yy component of the vector.

Static Fields

Value

Description

zerohalf2 zero value.

Constructors

Constructor

Description

half2(System.Double)Constructs a half2 vector from a single double value by converting it to half and assigning it to every component.
half2(System.Single)Constructs a half2 vector from a single float value by converting it to half and assigning it to every component.
half2(Unity.Mathematics.double2)Constructs a half2 vector from a double2 vector by componentwise conversion.
half2(Unity.Mathematics.float2)Constructs a half2 vector from a float2 vector by componentwise conversion.
half2(Unity.Mathematics.half)Constructs a half2 vector from a single half value by assigning it to every component.
half2(Unity.Mathematics.half,Unity.Mathematics.half)Constructs a half2 vector from two half values.
half2(Unity.Mathematics.half2)Constructs a half2 vector from a half2 vector.

Properties

Property

Description

this[]Returns the half element at a specified index.
xxSwizzles the vector.
xxxSwizzles the vector.
xxxxSwizzles the vector.
xxxySwizzles the vector.
xxySwizzles the vector.
xxyxSwizzles the vector.
xxyySwizzles the vector.
xySwizzles the vector.
xyxSwizzles the vector.
xyxxSwizzles the vector.
xyxySwizzles the vector.
xyySwizzles the vector.
xyyxSwizzles the vector.
xyyySwizzles the vector.
yxSwizzles the vector.
yxxSwizzles the vector.
yxxxSwizzles the vector.
yxxySwizzles the vector.
yxySwizzles the vector.
yxyxSwizzles the vector.
yxyySwizzles the vector.
yySwizzles the vector.
yyxSwizzles the vector.
yyxxSwizzles the vector.
yyxySwizzles the vector.
yyySwizzles the vector.
yyyxSwizzles the vector.
yyyySwizzles the vector.

Methods

Method

Description

EqualsReturns true if the half2 is equal to a given half2, false otherwise.
GetHashCodeReturns a hash code for the half2.
ToStringReturns a string representation of the half2.

Operators

Operator

Description

operator ==Returns the result of a componentwise equality operation on a half value and a half2 vector.
half2Explicitly converts a single double value to a half2 vector by converting it to half and assigning it to every component.
operator !=Returns the result of a componentwise not equal operation on a half value and a half2 vector.