half2
A 2 component vector of halfs.
Read time 2 minutesLast updated 4 days ago
Definition
- Type: Struct
- Namespace: Unity.Mathematics
- Assembly: UnityEngine.MathematicsModule
- Implements: IEquatable<half2>, IFormattable
public struct half2 : IEquatable<half2>, IFormattable
Fields
Static Fields
Value | Description |
|---|---|
| zero | half2 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. |
| 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
Method | Description |
|---|---|
| Equals | 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. |
Operators
Operator | Description |
|---|---|
| operator == | Returns the result of a componentwise equality operation on a half value and a half2 vector. |
| half2 | Explicitly 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. |