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(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 vector. |
Half | y | The Y component of the vector. |
Half | z | The Z component of the vector. |
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(Vector3, bool)
Initializes a new instance of the Vector3h struct.
Declaration
public Vector3h(Vector3 v, bool throwOnError)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | v | The Vector3 to convert. |
bool | throwOnError | Enable checks that will throw if the conversion result is not meaningful. |
Vector3h(Vector3)
Initializes a new instance of the Vector3h struct.
Declaration
public Vector3h(Vector3 v)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | v | The Vector3 to convert. |
Vector3h(in Vector3, bool)
Initializes a new instance of the Vector3h struct.
Declaration
public Vector3h(in Vector3 v, bool throwOnError)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | v | The Vector3 to convert. |
bool | throwOnError | Enable checks that will throw if the conversion result is not meaningful. |
Vector3h(in Vector3)
Initializes a new instance of the Vector3h struct.
Declaration
public Vector3h(in Vector3 v)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | v | The Vector3 to convert. |
Vector3h(Vector3d, bool)
Initializes a new instance of the Vector3h struct.
Declaration
public Vector3h(Vector3d v, bool throwOnError)
Parameters
Type | Name | Description |
---|---|---|
Vector3d | v | The Vector3d to convert. |
bool | throwOnError | Enable checks that will throw if the conversion result is not meaningful. |
Vector3h(Vector3d)
Initializes a new instance of the Vector3h struct.
Declaration
public Vector3h(Vector3d v)
Parameters
Type | Name | Description |
---|---|---|
Vector3d | v | The Vector3d to convert. |
Vector3h(in Vector3d, bool)
Initializes a new instance of the Vector3h struct.
Declaration
public Vector3h(in Vector3d v, bool throwOnError)
Parameters
Type | Name | Description |
---|---|---|
Vector3d | v | The Vector3d to convert. |
bool | throwOnError | Enable checks that will throw if the conversion result is not meaningful. |
Vector3h(in Vector3d)
Initializes a new instance of the Vector3h struct.
Declaration
public Vector3h(in Vector3d v)
Parameters
Type | Name | Description |
---|---|---|
Vector3d | v | The Vector3d to convert. |
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, float, float, bool)
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, bool throwOnError)
Parameters
Type | Name | Description |
---|---|---|
float | x | The X component of the vector. |
float | y | The Y component of the vector. |
float | z | The Z component of the vector. |
bool | throwOnError | Enable checks that will throw if the conversion result is not meaningful. |
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 vector. |
float | y | The Y component of the vector. |
float | z | The Z component of the vector. |
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. |
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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 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)
Declaration
public bool Equals(Vector3h other)
Parameters
Type | Name | Description |
---|---|---|
Vector3h | other |
Returns
Type | Description |
---|---|
bool |
Equals(object)
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj |
Returns
Type | Description |
---|---|
bool |
Overrides
FromBinaryStream(BinaryReader)
Updates the X,Y and Z components of this instance by reading from a Stream.
Declaration
public void FromBinaryStream(BinaryReader bin)
Parameters
Type | Name | Description |
---|---|---|
BinaryReader | bin | A BinaryReader instance associated with an open Stream. |
FromBytes(byte[], int)
Converts an array of bytes into Half3.
Declaration
[Pure]
public static Vector3h FromBytes(byte[] value, int startIndex)
Parameters
Type | Name | Description |
---|---|---|
byte[] | value | A Half3 in it's byte[] representation. |
int | startIndex | The starting position within value. |
Returns
Type | Description |
---|---|
Vector3h | A new Half3 instance. |
GetBytes(Vector3h)
Returns the Half3 as an array of bytes.
Declaration
[Pure]
public static byte[] GetBytes(Vector3h h)
Parameters
Type | Name | Description |
---|---|---|
Vector3h | h | The Half3 to convert. |
Returns
Type | Description |
---|---|
byte[] | The input as byte array. |
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int |
Overrides
GetObjectData(SerializationInfo, StreamingContext)
Declaration
public void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
SerializationInfo | info | |
StreamingContext | context |
ToBinaryStream(BinaryWriter)
Writes the X,Y and Z components of this instance into a Stream.
Declaration
public void ToBinaryStream(BinaryWriter bin)
Parameters
Type | Name | Description |
---|---|---|
BinaryWriter | bin | A BinaryWriter instance associated with an open Stream. |
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string |
Overrides
ToString(IFormatProvider)
Declaration
public string ToString(IFormatProvider formatProvider)
Parameters
Type | Name | Description |
---|---|---|
IFormatProvider | formatProvider |
Returns
Type | Description |
---|---|
string |
ToString(string, IFormatProvider)
Declaration
public string ToString(string format, IFormatProvider formatProvider)
Parameters
Type | Name | Description |
---|---|---|
string | format | |
IFormatProvider | formatProvider |
Returns
Type | Description |
---|---|
string |
ToString(string)
Declaration
public string ToString(string format)
Parameters
Type | Name | Description |
---|---|---|
string | format |
Returns
Type | Description |
---|---|
string |
ToVector3()
Returns this Half3 instance's contents as Vector3.
Declaration
public Vector3 ToVector3()
Returns
Type | Description |
---|---|
Vector3 | The vector. |
ToVector3d()
Returns this Half3 instance's contents as Vector3d.
Declaration
public 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. |