Struct Vector3h
3-component Vector of the Half type. Occupies 6 Byte total.
Inherited Members
Namespace: OpenTK
Assembly: OpenTK.dll
Syntax
[Serializable]
public struct Vector3h : ISerializable, IEquatable<Vector3h>
Constructors
Vector3h(Half)
Constructs a new instance.
Declaration
public Vector3h(Half value)
Parameters
Type | Name | Description |
---|---|---|
Half | value | The value that will initialize this instance. |
Vector3h(Half, Half, Half)
The new Half3 instance will avoid conversion and copy directly from the Half parameters.
Declaration
public Vector3h(Half x, Half y, Half z)
Parameters
Type | Name | Description |
---|---|---|
Half | x | An Half instance of a 16-bit half-precision floating-point number. |
Half | y | An Half instance of a 16-bit half-precision floating-point number. |
Half | z | An Half instance of a 16-bit half-precision floating-point number. |
Vector3h(Vector3)
The new Half3 instance will convert the Vector3 into 16-bit half-precision floating-point.
Declaration
[CLSCompliant(false)]
public Vector3h(Vector3 v)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | v | OpenTK.Vector3 |
Vector3h(Vector3, Boolean)
The new Half3 instance will convert the Vector3 into 16-bit half-precision floating-point.
Declaration
[CLSCompliant(false)]
public Vector3h(Vector3 v, bool throwOnError)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | v | OpenTK.Vector3 |
Boolean | throwOnError | Enable checks that will throw if the conversion result is not meaningful. |
Vector3h(ref Vector3)
The new Half3 instance will convert the Vector3 into 16-bit half-precision floating-point. This is the fastest constructor.
Declaration
public Vector3h(ref Vector3 v)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | v | OpenTK.Vector3 |
Vector3h(ref Vector3, Boolean)
The new Half3 instance will convert the Vector3 into 16-bit half-precision floating-point.
Declaration
[CLSCompliant(false)]
public Vector3h(ref Vector3 v, bool throwOnError)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | v | OpenTK.Vector3 |
Boolean | throwOnError | Enable checks that will throw if the conversion result is not meaningful. |
Vector3h(Vector3d)
The new Half3 instance will convert the Vector3d into 16-bit half-precision floating-point.
Declaration
[CLSCompliant(false)]
public Vector3h(Vector3d v)
Parameters
Type | Name | Description |
---|---|---|
Vector3d | v | OpenTK.Vector3d |
Vector3h(Vector3d, Boolean)
The new Half3 instance will convert the Vector3d into 16-bit half-precision floating-point.
Declaration
[CLSCompliant(false)]
public Vector3h(Vector3d v, bool throwOnError)
Parameters
Type | Name | Description |
---|---|---|
Vector3d | v | OpenTK.Vector3d |
Boolean | throwOnError | Enable checks that will throw if the conversion result is not meaningful. |
Vector3h(ref Vector3d)
The new Half3 instance will convert the Vector3d into 16-bit half-precision floating-point. This is the faster constructor.
Declaration
[CLSCompliant(false)]
public Vector3h(ref Vector3d v)
Parameters
Type | Name | Description |
---|---|---|
Vector3d | v | OpenTK.Vector3d |
Vector3h(ref Vector3d, Boolean)
The new Half3 instance will convert the Vector3d into 16-bit half-precision floating-point.
Declaration
[CLSCompliant(false)]
public Vector3h(ref Vector3d v, bool throwOnError)
Parameters
Type | Name | Description |
---|---|---|
Vector3d | v | OpenTK.Vector3d |
Boolean | throwOnError | Enable checks that will throw if the conversion result is not meaningful. |
Vector3h(SerializationInfo, StreamingContext)
Constructor used by ISerializable to deserialize the object.
Declaration
public Vector3h(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
SerializationInfo | info | |
StreamingContext | context |
Vector3h(Single)
Constructs a new instance.
Declaration
public Vector3h(float value)
Parameters
Type | Name | Description |
---|---|---|
Single | value | The value that will initialize this instance. |
Vector3h(Single, Single, Single)
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 |
---|---|---|
Single | x | 32-bit single-precision floating-point number. |
Single | y | 32-bit single-precision floating-point number. |
Single | z | 32-bit single-precision floating-point number. |
Vector3h(Single, Single, Single, Boolean)
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 |
---|---|---|
Single | x | 32-bit single-precision floating-point number. |
Single | y | 32-bit single-precision floating-point number. |
Single | z | 32-bit single-precision floating-point number. |
Boolean | throwOnError | Enable checks that will throw if the conversion result is not meaningful. |
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 |
---|---|
Int32 |
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
Equals(Vector3h)
Returns a value indicating whether this instance is equal to a specified OpenTK.Half3 vector.
Declaration
public bool Equals(Vector3h other)
Parameters
Type | Name | Description |
---|---|---|
Vector3h | other | OpenTK.Half3 to compare to this instance.. |
Returns
Type | Description |
---|---|
Boolean | True, if other is equal to this instance; false otherwise. |
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[], Int32)
Converts an array of bytes into Half3.
Declaration
public static Vector3h FromBytes(byte[] value, int startIndex)
Parameters
Type | Name | Description |
---|---|---|
Byte[] | value | A Half3 in it's byte[] representation. |
Int32 | 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
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. |
GetObjectData(SerializationInfo, StreamingContext)
Used by ISerialize to serialize the object.
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()
Returns a string that contains this Half3's numbers in human-legible form.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String |
Overrides
ToVector3()
Returns this Half3 instance's contents as Vector3.
Declaration
public Vector3 ToVector3()
Returns
Type | Description |
---|---|
Vector3 | OpenTK.Vector3 |
ToVector3d()
Returns this Half3 instance's contents as Vector3d.
Declaration
public Vector3d ToVector3d()
Returns
Type | Description |
---|---|
Vector3d |
Operators
Explicit(Vector3 to Vector3h)
Converts OpenTK.Vector3 to OpenTK.Half3.
Declaration
public static explicit operator Vector3h(Vector3 v3f)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | v3f | The Vector3 to convert. |
Returns
Type | Description |
---|---|
Vector3h | The resulting Half vector. |
Explicit(Vector3d to Vector3h)
Converts OpenTK.Vector3d to OpenTK.Half3.
Declaration
public static explicit operator Vector3h(Vector3d v3d)
Parameters
Type | Name | Description |
---|---|---|
Vector3d | v3d | The Vector3d to convert. |
Returns
Type | Description |
---|---|
Vector3h | The resulting Half vector. |
Explicit(Vector3h to Vector3)
Converts OpenTK.Half3 to OpenTK.Vector3.
Declaration
public static explicit operator Vector3(Vector3h h3)
Parameters
Type | Name | Description |
---|---|---|
Vector3h | h3 | The Half3 to convert. |
Returns
Type | Description |
---|---|
Vector3 | The resulting Vector3. |
Explicit(Vector3h to Vector3d)
Converts OpenTK.Half3 to OpenTK.Vector3d.
Declaration
public static explicit operator Vector3d(Vector3h h3)
Parameters
Type | Name | Description |
---|---|---|
Vector3h | h3 | The Half3 to convert. |
Returns
Type | Description |
---|---|
Vector3d | The resulting Vector3d. |