Struct half2
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
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
Parameters
Type |
Name |
Description |
System.Single |
v |
|
half2(double2)
Constructs a half2 vector from a double2 vector by componentwise conversion.
Declaration
Parameters
half2(float2)
Constructs a half2 vector from a float2 vector by componentwise conversion.
Declaration
Parameters
Type |
Name |
Description |
float2 |
v |
|
half2(half)
Constructs a half2 vector from a single half value by assigning it to every component.
Declaration
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
half2(half2)
Constructs a half2 vector from a half2 vector.
Declaration
Parameters
Type |
Name |
Description |
half2 |
xy |
|
Fields
x
Declaration
Field Value
y
Declaration
Field Value
zero
Declaration
public static readonly half2 zero
Field Value
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
xx
Declaration
Property Value
xxx
Declaration
public half3 xxx { get; }
Property Value
xxxx
Declaration
public half4 xxxx { get; }
Property Value
xxxy
Declaration
public half4 xxxy { get; }
Property Value
xxy
Declaration
public half3 xxy { get; }
Property Value
xxyx
Declaration
public half4 xxyx { get; }
Property Value
xxyy
Declaration
public half4 xxyy { get; }
Property Value
xy
Declaration
public half2 xy { get; set; }
Property Value
xyx
Declaration
public half3 xyx { get; }
Property Value
xyxx
Declaration
public half4 xyxx { get; }
Property Value
xyxy
Declaration
public half4 xyxy { get; }
Property Value
xyy
Declaration
public half3 xyy { get; }
Property Value
xyyx
Declaration
public half4 xyyx { get; }
Property Value
xyyy
Declaration
public half4 xyyy { get; }
Property Value
yx
Declaration
public half2 yx { get; set; }
Property Value
yxx
Declaration
public half3 yxx { get; }
Property Value
yxxx
Declaration
public half4 yxxx { get; }
Property Value
yxxy
Declaration
public half4 yxxy { get; }
Property Value
yxy
Declaration
public half3 yxy { get; }
Property Value
yxyx
Declaration
public half4 yxyx { get; }
Property Value
yxyy
Declaration
public half4 yxyy { get; }
Property Value
yy
Declaration
Property Value
yyx
Declaration
public half3 yyx { get; }
Property Value
yyxx
Declaration
public half4 yyxx { get; }
Property Value
yyxy
Declaration
public half4 yyxy { get; }
Property Value
yyy
Declaration
public half3 yyy { get; }
Property Value
yyyx
Declaration
public half4 yyyx { get; }
Property Value
yyyy
Declaration
public half4 yyyy { get; }
Property Value
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()
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
Returns
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
Returns
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
Returns
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
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
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
Returns
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
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
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
Returns
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
Returns
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
Returns