Half3 Struct
Namespace: Stride.Core.MathematicsAssembly: Stride.Core.Mathematics.dll
Represents a three dimensional mathematical vector with half-precision floats.
[DataContract]
public struct Half3 : IEquatable<Half3>
Name | Description | |
---|---|---|
Constructors | ||
Half3(Half) | Initializes a new instance of the Half3 structure. |
|
Half3(Half, Half, Half) | Initializes a new instance of the Half3 structure. |
|
Half3(Half[]) | Initializes a new instance of the Half3 struct. |
|
Half3(Single) | Initializes a new instance of the Half3 structure. |
|
Half3(Single, Single, Single) | Initializes a new instance of the Half3 structure. |
|
Fields | ||
One | A Half3 with all of its components set to one. |
|
SizeInBytes | The size of the Half3 type, in bytes. |
|
UnitX | The X unit Half3 (1, 0, 0). |
|
UnitY | The Y unit Half3 (0, 1, 0). |
|
UnitZ | The Z unit Half3 (0, 0, 1). |
|
X | Gets or sets the X component of the vector. |
|
Y | Gets or sets the Y component of the vector. |
|
Z | Gets or sets the Z component of the vector. |
|
Zero | A Half3 with all of its components set to zero. |
|
Methods | ||
Equals(Half3) | Returns a value that indicates whether the current instance is equal to the specified object. |
|
Equals(ref Half3, ref Half3) | Determines whether the specified object instances are considered equal. |
|
Equals(Object) | Returns a value that indicates whether the current instance is equal to a specified object. |
|
GetHashCode() | Returns the hash code for this instance. |
|
Operators | ||
Equality(Half3, Half3) | Tests for equality between two objects. |
|
Explicit(Half3 to Vector3) | ||
Explicit(Vector3 to Half3) | ||
Inequality(Half3, Half3) | Tests for inequality between two objects. |
Constructors
Half3(Half)
Initializes a new instance of the Half3 structure.
public Half3(Half value)
Parameters
Type | Name | Description |
---|---|---|
Half | value | The value to set for the X, Y, and Z components. |
Half3(Half, Half, Half)
Initializes a new instance of the Half3 structure.
public Half3(Half x, Half y, Half z)
Parameters
Type | Name | Description |
---|---|---|
Half | x | The X component. |
Half | y | The Y component. |
Half | z | The Z component. |
Half3(Half[])
Initializes a new instance of the Half3 struct.
public Half3(Half[] values)
Parameters
Type | Name | Description |
---|---|---|
Half[] | values | The values to assign to the X, Y, and Z components of the vector. This must be an array with three elements. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown when |
System.ArgumentOutOfRangeException | Thrown when |
Half3(Single)
Initializes a new instance of the Half3 structure.
public Half3(float value)
Parameters
Type | Name | Description |
---|---|---|
System.Single | value | The value to set for the X, Y, and Z components. |
Half3(Single, Single, Single)
Initializes a new instance of the Half3 structure.
public Half3(float x, float y, float z)
Parameters
Type | Name | Description |
---|---|---|
System.Single | x | The X component. |
System.Single | y | The Y component. |
System.Single | z | The Z component. |
Fields
One
A Half3 with all of its components set to one.
public static readonly Half3 One
Field Value
Type | Description |
---|---|
Half3 |
SizeInBytes
The size of the Half3 type, in bytes.
public static readonly int SizeInBytes
Field Value
Type | Description |
---|---|
System.Int32 |
UnitX
The X unit Half3 (1, 0, 0).
public static readonly Half3 UnitX
Field Value
Type | Description |
---|---|
Half3 |
UnitY
The Y unit Half3 (0, 1, 0).
public static readonly Half3 UnitY
Field Value
Type | Description |
---|---|
Half3 |
UnitZ
The Z unit Half3 (0, 0, 1).
public static readonly Half3 UnitZ
Field Value
Type | Description |
---|---|
Half3 |
X
Gets or sets the X component of the vector.
public Half X
Field Value
Type | Description |
---|---|
Half | The X component of the vector. |
Y
Gets or sets the Y component of the vector.
public Half Y
Field Value
Type | Description |
---|---|
Half | The Y component of the vector. |
Z
Gets or sets the Z component of the vector.
public Half Z
Field Value
Type | Description |
---|---|
Half | The Z component of the vector. |
Zero
A Half3 with all of its components set to zero.
public static readonly Half3 Zero
Field Value
Type | Description |
---|---|
Half3 |
Methods
Equals(Half3)
Returns a value that indicates whether the current instance is equal to the specified object.
public bool Equals(Half3 other)
Parameters
Type | Name | Description |
---|---|---|
Half3 | other | Object to make the comparison with. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Equals(ref Half3, ref Half3)
Determines whether the specified object instances are considered equal.
public static bool Equals(ref Half3 value1, ref Half3 value2)
Parameters
Type | Name | Description |
---|---|---|
Half3 | value1 | The first value. |
Half3 | value2 | The second value. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Equals(Object)
Returns a value that indicates whether the current instance is equal to a specified object.
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | Object to make the comparison with. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Overrides
GetHashCode()
Returns the hash code for this instance.
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | A 32-bit signed integer hash code. |
Overrides
Operators
Equality(Half3, Half3)
Tests for equality between two objects.
public static bool operator ==(Half3 left, Half3 right)
Parameters
Type | Name | Description |
---|---|---|
Half3 | left | The first value to compare. |
Half3 | right | The second value to compare. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Explicit(Half3 to Vector3)
public static explicit operator Vector3(Half3 value)
Parameters
Type | Name | Description |
---|---|---|
Half3 | value | The value. |
Returns
Type | Description |
---|---|
Vector3 | The result of the conversion. |
Explicit(Vector3 to Half3)
public static explicit operator Half3(Vector3 value)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | value | The value. |
Returns
Type | Description |
---|---|
Half3 | The result of the conversion. |
Inequality(Half3, Half3)
Tests for inequality between two objects.
public static bool operator !=(Half3 left, Half3 right)
Parameters
Type | Name | Description |
---|---|---|
Half3 | left | The first value to compare. |
Half3 | right | The second value to compare. |
Returns
Type | Description |
---|---|
System.Boolean |
|