Struct Vector2h
2-component Vector of the Half type. Occupies 4 Byte total.
Inherited Members
Namespace: OpenTK
Assembly: cs.temp.dll.dll
Syntax
[Serializable]
public struct Vector2h : ISerializable, IEquatable<Vector2h>
Constructors
Vector2h(Half)
Constructs a new instance.
Declaration
public Vector2h(Half value)
Parameters
Type | Name | Description |
---|---|---|
Half | value | The value that will initialize this instance. |
Vector2h(Half, Half)
The new Half2 instance will avoid conversion and copy directly from the Half parameters.
Declaration
public Vector2h(Half x, Half y)
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. |
Vector2h(Vector2)
The new Half2 instance will convert the Vector2 into 16-bit half-precision floating-point.
Declaration
[CLSCompliant(false)]
public Vector2h(Vector2 v)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | v | OpenTK.Vector2 |
Vector2h(Vector2, Boolean)
The new Half2 instance will convert the Vector2 into 16-bit half-precision floating-point.
Declaration
[CLSCompliant(false)]
public Vector2h(Vector2 v, bool throwOnError)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | v | OpenTK.Vector2 |
System.Boolean | throwOnError | Enable checks that will throw if the conversion result is not meaningful. |
Vector2h(ref Vector2)
The new Half2 instance will convert the Vector2 into 16-bit half-precision floating-point. This is the fastest constructor.
Declaration
public Vector2h(ref Vector2 v)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | v | OpenTK.Vector2 |
Vector2h(ref Vector2, Boolean)
The new Half2 instance will convert the Vector2 into 16-bit half-precision floating-point.
Declaration
public Vector2h(ref Vector2 v, bool throwOnError)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | v | OpenTK.Vector2 |
System.Boolean | throwOnError | Enable checks that will throw if the conversion result is not meaningful. |
Vector2h(Vector2d)
The new Half2 instance will convert the Vector2d into 16-bit half-precision floating-point.
Declaration
[CLSCompliant(false)]
public Vector2h(Vector2d v)
Parameters
Type | Name | Description |
---|---|---|
Vector2d | v | OpenTK.Vector2d |
Vector2h(Vector2d, Boolean)
The new Half2 instance will convert the Vector2d into 16-bit half-precision floating-point.
Declaration
[CLSCompliant(false)]
public Vector2h(Vector2d v, bool throwOnError)
Parameters
Type | Name | Description |
---|---|---|
Vector2d | v | OpenTK.Vector2d |
System.Boolean | throwOnError | Enable checks that will throw if the conversion result is not meaningful. |
Vector2h(ref Vector2d)
The new Half2 instance will convert the Vector2d into 16-bit half-precision floating-point. This is the faster constructor.
Declaration
[CLSCompliant(false)]
public Vector2h(ref Vector2d v)
Parameters
Type | Name | Description |
---|---|---|
Vector2d | v | OpenTK.Vector2d |
Vector2h(ref Vector2d, Boolean)
The new Half2 instance will convert the Vector2d into 16-bit half-precision floating-point.
Declaration
[CLSCompliant(false)]
public Vector2h(ref Vector2d v, bool throwOnError)
Parameters
Type | Name | Description |
---|---|---|
Vector2d | v | OpenTK.Vector2d |
System.Boolean | throwOnError | Enable checks that will throw if the conversion result is not meaningful. |
Vector2h(SerializationInfo, StreamingContext)
Constructor used by ISerializable to deserialize the object.
Declaration
public Vector2h(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
SerializationInfo | info | |
StreamingContext | context |
Vector2h(Single)
Constructs a new instance.
Declaration
public Vector2h(float value)
Parameters
Type | Name | Description |
---|---|---|
System.Single | value | The value that will initialize this instance. |
Vector2h(Single, Single)
The new Half2 instance will convert the 2 parameters into 16-bit half-precision floating-point.
Declaration
public Vector2h(float x, float y)
Parameters
Type | Name | Description |
---|---|---|
System.Single | x | 32-bit single-precision floating-point number. |
System.Single | y | 32-bit single-precision floating-point number. |
Vector2h(Single, Single, Boolean)
The new Half2 instance will convert the 2 parameters into 16-bit half-precision floating-point.
Declaration
public Vector2h(float x, float y, bool throwOnError)
Parameters
Type | Name | Description |
---|---|---|
System.Single | x | 32-bit single-precision floating-point number. |
System.Single | y | 32-bit single-precision floating-point number. |
System.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 Half2 struct is 4.
Declaration
public static readonly int SizeInBytes
Field Value
Type | Description |
---|---|
System.Int32 |
X
The X component of the Half2.
Declaration
public Half X
Field Value
Type | Description |
---|---|
Half |
Y
The Y component of the Half2.
Declaration
public Half Y
Field Value
Type | Description |
---|---|
Half |
Properties
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 |
Methods
Equals(Vector2h)
Returns a value indicating whether this instance is equal to a specified OpenTK.Half2 vector.
Declaration
public bool Equals(Vector2h other)
Parameters
Type | Name | Description |
---|---|---|
Vector2h | other | OpenTK.Half2 to compare to this instance.. |
Returns
Type | Description |
---|---|
System.Boolean | True, if other is equal to this instance; false otherwise. |
FromBinaryStream(BinaryReader)
Updates the X and Y components of this instance by reading from a Stream.
Declaration
public void FromBinaryStream(BinaryReader bin)
Parameters
Type | Name | Description |
---|---|---|
System.IO.BinaryReader | bin | A BinaryReader instance associated with an open Stream. |
FromBytes(Byte[], Int32)
Converts an array of bytes into Half2.
Declaration
public static Vector2h FromBytes(byte[] value, int startIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | value | A Half2 in it's byte[] representation. |
System.Int32 | startIndex | The starting position within value. |
Returns
Type | Description |
---|---|
Vector2h | A new Half2 instance. |
GetBytes(Vector2h)
Returns the Half2 as an array of bytes.
Declaration
public static byte[] GetBytes(Vector2h h)
Parameters
Type | Name | Description |
---|---|---|
Vector2h | h | The Half2 to convert. |
Returns
Type | Description |
---|---|
System.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 and Y components of this instance into a Stream.
Declaration
public void ToBinaryStream(BinaryWriter bin)
Parameters
Type | Name | Description |
---|---|---|
System.IO.BinaryWriter | bin | A BinaryWriter instance associated with an open Stream. |
ToString()
Returns a string that contains this Half2's numbers in human-legible form.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String |
Overrides
ToVector2()
Returns this Half2 instance's contents as Vector2.
Declaration
public Vector2 ToVector2()
Returns
Type | Description |
---|---|
Vector2 | OpenTK.Vector2 |
ToVector2d()
Returns this Half2 instance's contents as Vector2d.
Declaration
public Vector2d ToVector2d()
Returns
Type | Description |
---|---|
Vector2d |
Operators
Explicit(Vector2 to Vector2h)
Converts OpenTK.Vector2 to OpenTK.Half2.
Declaration
public static explicit operator Vector2h(Vector2 v)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | v | The Vector2 to convert. |
Returns
Type | Description |
---|---|
Vector2h | The resulting Half vector. |
Explicit(Vector2d to Vector2h)
Converts OpenTK.Vector2d to OpenTK.Half2.
Declaration
public static explicit operator Vector2h(Vector2d v)
Parameters
Type | Name | Description |
---|---|---|
Vector2d | v | The Vector2d to convert. |
Returns
Type | Description |
---|---|
Vector2h | The resulting Half vector. |
Explicit(Vector2h to Vector2)
Converts OpenTK.Half2 to OpenTK.Vector2.
Declaration
public static explicit operator Vector2(Vector2h h)
Parameters
Type | Name | Description |
---|---|---|
Vector2h | h | The Half2 to convert. |
Returns
Type | Description |
---|---|
Vector2 | The resulting Vector2. |
Explicit(Vector2h to Vector2d)
Converts OpenTK.Half2 to OpenTK.Vector2d.
Declaration
public static explicit operator Vector2d(Vector2h h)
Parameters
Type | Name | Description |
---|---|---|
Vector2h | h | The Half2 to convert. |
Returns
Type | Description |
---|---|
Vector2d | The resulting Vector2d. |