Struct Vector3h
3-component Vector of the Half type. Occupies 6 Byte total.
Inherited Members
Namespace: OpenTK.Mathematics
Assembly: OpenTK.Mathematics.dll
Syntax
[Serializable]
public struct Vector3h : ISerializable, IEquatable<Vector3h>, IFormattable
Constructors
Vector3h(Vector2h, Half)
Initializes a new instance of the Vector3h struct.
Declaration
public Vector3h(Vector2h xy, Half z = default)
Parameters
Type | Name | Description |
---|---|---|
Vector2h | xy | The x and y components of the Vector3h. |
Half | z | The z component of the Vector3h. |
Vector3h(Vector2h, float)
Initializes a new instance of the Vector3h struct.
Declaration
public Vector3h(Vector2h xy, float z = 0)
Parameters
Type | Name | Description |
---|---|---|
Vector2h | xy | The x and y components of the Vector3h. |
float | z | The z component of the Vector3h. |
Vector3h(Half)
Initializes a new instance of the Vector3h struct.
Declaration
public Vector3h(Half value)
Parameters
Type | Name | Description |
---|---|---|
Half | value | The value that will initialize this instance. |
Vector3h(Half, Half, Half)
Initializes a new instance of the Vector3h struct.
Declaration
public Vector3h(Half x, Half y, Half z)
Parameters
Type | Name | Description |
---|---|---|
Half | x | The x component of the Vector3h. |
Half | y | The y component of the Vector3h. |
Half | z | The z component of the Vector3h. |
Vector3h(SerializationInfo, StreamingContext)
Initializes a new instance of the Vector3h struct.
Declaration
[Pure]
public Vector3h(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
SerializationInfo | info | The serialization info. |
StreamingContext | context | The streaming context. |
Vector3h(float)
Initializes a new instance of the Vector3h struct.
Declaration
public Vector3h(float value)
Parameters
Type | Name | Description |
---|---|---|
float | value | The value that will initialize this instance. |
Vector3h(float, float, float)
Initializes a new instance of the Vector3h struct. The new Half3 instance will convert the 3 parameters into 16-bit half-precision floating-point.
Declaration
public Vector3h(float x, float y, float z)
Parameters
Type | Name | Description |
---|---|---|
float | x | The x component of the Vector3h. |
float | y | The y component of the Vector3h. |
float | z | The z component of the Vector3h. |
Fields
SizeInBytes
The size in bytes for an instance of the Half3 struct is 6.
Declaration
public static readonly int SizeInBytes
Field Value
Type | Description |
---|---|
int |
X
The X component of the Half3.
Declaration
public Half X
Field Value
Type | Description |
---|---|
Half |
Y
The Y component of the Half3.
Declaration
public Half Y
Field Value
Type | Description |
---|---|
Half |
Z
The Z component of the Half3.
Declaration
public Half Z
Field Value
Type | Description |
---|---|
Half |
Properties
Xy
Gets or sets an OpenTK.Vector2h with the X and Y components of this instance.
Declaration
public Vector2h Xy { get; set; }
Property Value
Type | Description |
---|---|
Vector2h |
Xz
Gets or sets an OpenTK.Vector2h with the X and Z components of this instance.
Declaration
public Vector2h Xz { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector2h |
Xzy
Gets or sets an OpenTK.Vector3h with the X, Z, and Y components of this instance.
Declaration
public Vector3h Xzy { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector3h |
Yx
Gets or sets an OpenTK.Vector2h with the Y and X components of this instance.
Declaration
public Vector2h Yx { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector2h |
Yxz
Gets or sets an OpenTK.Vector3h with the Y, X, and Z components of this instance.
Declaration
public Vector3h Yxz { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector3h |
Yz
Gets or sets an OpenTK.Vector2h with the Y and Z components of this instance.
Declaration
public Vector2h Yz { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector2h |
Yzx
Gets or sets an OpenTK.Vector3h with the Y, Z, and X components of this instance.
Declaration
public Vector3h Yzx { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector3h |
Zx
Gets or sets an OpenTK.Vector2h with the Z and X components of this instance.
Declaration
public Vector2h Zx { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector2h |
Zxy
Gets or sets an OpenTK.Vector3h with the Z, X, and Y components of this instance.
Declaration
public Vector3h Zxy { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector3h |
Zy
Gets or sets an OpenTK.Vector2h with the Z and Y components of this instance.
Declaration
public Vector2h Zy { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector2h |
Zyx
Gets or sets an OpenTK.Vector3h with the Z, Y, and X components of this instance.
Declaration
public Vector3h Zyx { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector3h |
Methods
Deconstruct(out Half, out Half, out Half)
Deconstructs the vector into it's individual components.
Declaration
[Pure]
public readonly void Deconstruct(out Half x, out Half y, out Half z)
Parameters
Type | Name | Description |
---|---|---|
Half | x | The X component of the vector. |
Half | y | The Y component of the vector. |
Half | z | The Z component of the vector. |
Equals(Vector3h)
Indicates whether the current object is equal to another object of the same type.
Declaration
public bool Equals(Vector3h other)
Parameters
Type | Name | Description |
---|---|---|
Vector3h | other | An object to compare with this object. |
Returns
Type | Description |
---|---|
bool | true if the current object is equal to the |
Equals(object)
Indicates whether this instance and a specified object are equal.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | The object to compare with the current instance. |
Returns
Type | Description |
---|---|
bool | true if |
Overrides
GetHashCode()
Returns the hash code for this instance.
Declaration
public override readonly int GetHashCode()
Returns
Type | Description |
---|---|
int | A 32-bit signed integer that is the hash code for this instance. |
Overrides
GetObjectData(SerializationInfo, StreamingContext)
Populates a SerializationInfo with the data needed to serialize the target object.
Declaration
public readonly void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
SerializationInfo | info | The SerializationInfo to populate with data. |
StreamingContext | context | The destination (see StreamingContext) for this serialization. |
Exceptions
Type | Condition |
---|---|
SecurityException | The caller does not have the required permission. |
ToString()
Returns the fully qualified type name of this instance.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | The fully qualified type name. |
Overrides
ToString(IFormatProvider)
Formats the value of the current instance using the specified format.
Declaration
public string ToString(IFormatProvider formatProvider)
Parameters
Type | Name | Description |
---|---|---|
IFormatProvider | formatProvider | The provider to use to format the value. -or- A null reference ( |
Returns
Type | Description |
---|---|
string | The value of the current instance in the specified format. |
ToString(string)
Formats the value of the current instance using the specified format.
Declaration
public string ToString(string format)
Parameters
Type | Name | Description |
---|---|---|
string | format | The format to use. -or- A null reference ( |
Returns
Type | Description |
---|---|
string | The value of the current instance in the specified format. |
ToString(string, IFormatProvider)
Formats the value of the current instance using the specified format.
Declaration
public string ToString(string format, IFormatProvider formatProvider)
Parameters
Type | Name | Description |
---|---|---|
string | format | The format to use. -or- A null reference ( |
IFormatProvider | formatProvider | The provider to use to format the value. -or- A null reference ( |
Returns
Type | Description |
---|---|
string | The value of the current instance in the specified format. |
ToVector3()
Returns this Half3 instance's contents as Vector3.
Declaration
public readonly Vector3 ToVector3()
Returns
Type | Description |
---|---|
Vector3 | The vector. |
ToVector3d()
Returns this Half3 instance's contents as Vector3d.
Declaration
public readonly Vector3d ToVector3d()
Returns
Type | Description |
---|---|
Vector3d | The vector. |
Operators
operator ==(Vector3h, Vector3h)
Compares two instances for equality.
Declaration
public static bool operator ==(Vector3h left, Vector3h right)
Parameters
Type | Name | Description |
---|---|---|
Vector3h | left | The first instance. |
Vector3h | right | The second instance. |
Returns
Type | Description |
---|---|
bool | True, if left equals right; false otherwise. |
explicit operator Vector3i(Vector3h)
Converts OpenTK.Vector3h to OpenTK.Vector3i.
Declaration
[Pure]
public static explicit operator Vector3i(Vector3h vec)
Parameters
Type | Name | Description |
---|---|---|
Vector3h | vec | The Vector3h to convert. |
Returns
Type | Description |
---|---|
Vector3i | The resulting Vector3i. |
implicit operator Vector3(Vector3h)
Converts OpenTK.Vector3h to OpenTK.Vector3.
Declaration
[Pure]
public static implicit operator Vector3(Vector3h vec)
Parameters
Type | Name | Description |
---|---|---|
Vector3h | vec | The Vector3h to convert. |
Returns
Type | Description |
---|---|
Vector3 | The resulting Vector3. |
implicit operator Vector3d(Vector3h)
Converts OpenTK.Vector3h to OpenTK.Vector3d.
Declaration
[Pure]
public static implicit operator Vector3d(Vector3h vec)
Parameters
Type | Name | Description |
---|---|---|
Vector3h | vec | The Vector3h to convert. |
Returns
Type | Description |
---|---|
Vector3d | The resulting Vector3d. |
implicit operator Vector3h((Half X, Half Y, Half Z))
Initializes a new instance of the Vector3h struct using a tuple containing the component values.
Declaration
[Pure]
public static implicit operator Vector3h((Half X, Half Y, Half Z) values)
Parameters
Type | Name | Description |
---|---|---|
(Half X, Half Y, Half Z) | values | A tuple containing the component values. |
Returns
Type | Description |
---|---|
Vector3h | A new instance of the Vector3h struct with the given component values. |
operator !=(Vector3h, Vector3h)
Compares two instances for inequality.
Declaration
public static bool operator !=(Vector3h left, Vector3h right)
Parameters
Type | Name | Description |
---|---|---|
Vector3h | left | The first instance. |
Vector3h | right | The second instance. |
Returns
Type | Description |
---|---|
bool | True, if left does not equal right; false otherwise. |