Show / Hide Table of Contents

Struct Vector4h

4-component Vector of the Half type. Occupies 8 Byte total.

Implements
ISerializable
IEquatable<Vector4h>
Inherited Members
ValueType.Equals(Object)
ValueType.GetHashCode()
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetType()
Namespace: OpenTK
Assembly: OpenTK.dll
Syntax
[Serializable]
public struct Vector4h : ISerializable, IEquatable<Vector4h>

Constructors

Vector4h(Half)

Constructs a new instance.

Declaration
public Vector4h(Half value)
Parameters
Type Name Description
Half value

The value that will initialize this instance.

Vector4h(Half, Half, Half, Half)

The new Half4 instance will avoid conversion and copy directly from the Half parameters.

Declaration
public Vector4h(Half x, Half y, Half z, Half w)
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.

Half w

An Half instance of a 16-bit half-precision floating-point number.

Vector4h(Vector4)

The new Half4 instance will convert the Vector4 into 16-bit half-precision floating-point.

Declaration
[CLSCompliant(false)]
public Vector4h(Vector4 v)
Parameters
Type Name Description
Vector4 v

OpenTK.Vector4

Vector4h(Vector4, Boolean)

The new Half4 instance will convert the Vector4 into 16-bit half-precision floating-point.

Declaration
[CLSCompliant(false)]
public Vector4h(Vector4 v, bool throwOnError)
Parameters
Type Name Description
Vector4 v

OpenTK.Vector4

Boolean throwOnError

Enable checks that will throw if the conversion result is not meaningful.

Vector4h(ref Vector4)

The new Half4 instance will convert the Vector4 into 16-bit half-precision floating-point. This is the fastest constructor.

Declaration
public Vector4h(ref Vector4 v)
Parameters
Type Name Description
Vector4 v

OpenTK.Vector4

Vector4h(ref Vector4, Boolean)

The new Half4 instance will convert the Vector4 into 16-bit half-precision floating-point.

Declaration
public Vector4h(ref Vector4 v, bool throwOnError)
Parameters
Type Name Description
Vector4 v

OpenTK.Vector4

Boolean throwOnError

Enable checks that will throw if the conversion result is not meaningful.

Vector4h(Vector4d)

The new Half4 instance will convert the Vector4d into 16-bit half-precision floating-point.

Declaration
[CLSCompliant(false)]
public Vector4h(Vector4d v)
Parameters
Type Name Description
Vector4d v

OpenTK.Vector4d

Vector4h(Vector4d, Boolean)

The new Half4 instance will convert the Vector4d into 16-bit half-precision floating-point.

Declaration
[CLSCompliant(false)]
public Vector4h(Vector4d v, bool throwOnError)
Parameters
Type Name Description
Vector4d v

OpenTK.Vector4d

Boolean throwOnError

Enable checks that will throw if the conversion result is not meaningful.

Vector4h(ref Vector4d)

The new Half4 instance will convert the Vector4d into 16-bit half-precision floating-point. This is the faster constructor.

Declaration
[CLSCompliant(false)]
public Vector4h(ref Vector4d v)
Parameters
Type Name Description
Vector4d v

OpenTK.Vector4d

Vector4h(ref Vector4d, Boolean)

The new Half4 instance will convert the Vector4d into 16-bit half-precision floating-point.

Declaration
[CLSCompliant(false)]
public Vector4h(ref Vector4d v, bool throwOnError)
Parameters
Type Name Description
Vector4d v

OpenTK.Vector4d

Boolean throwOnError

Enable checks that will throw if the conversion result is not meaningful.

Vector4h(SerializationInfo, StreamingContext)

Constructor used by ISerializable to deserialize the object.

Declaration
public Vector4h(SerializationInfo info, StreamingContext context)
Parameters
Type Name Description
SerializationInfo info
StreamingContext context

Vector4h(Single)

Constructs a new instance.

Declaration
public Vector4h(float value)
Parameters
Type Name Description
Single value

The value that will initialize this instance.

Vector4h(Single, Single, Single, Single)

The new Half4 instance will convert the 4 parameters into 16-bit half-precision floating-point.

Declaration
public Vector4h(float x, float y, float z, float w)
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.

Single w

32-bit single-precision floating-point number.

Vector4h(Single, Single, Single, Single, Boolean)

The new Half4 instance will convert the 4 parameters into 16-bit half-precision floating-point.

Declaration
public Vector4h(float x, float y, float z, float w, 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.

Single w

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 Half4 struct is 8.

Declaration
public static readonly int SizeInBytes
Field Value
Type Description
Int32

W

The W component of the Half4.

Declaration
public Half W
Field Value
Type Description
Half

X

The X component of the Half4.

Declaration
public Half X
Field Value
Type Description
Half

Y

The Y component of the Half4.

Declaration
public Half Y
Field Value
Type Description
Half

Z

The Z component of the Half4.

Declaration
public Half Z
Field Value
Type Description
Half

Properties

Wx

Gets or sets an OpenTK.Vector2h with the W and X components of this instance.

Declaration
public Vector2h Wx { get; set; }
Property Value
Type Description
Vector2h

Wxy

Gets or sets an OpenTK.Vector3h with the W, X, and Y components of this instance.

Declaration
public Vector3h Wxy { get; set; }
Property Value
Type Description
Vector3h

Wxyz

Gets or sets an OpenTK.Vector4h with the W, X, Y, and Z components of this instance.

Declaration
public Vector4h Wxyz { get; set; }
Property Value
Type Description
Vector4h

Wxz

Gets or sets an OpenTK.Vector3h with the W, X, and Z components of this instance.

Declaration
public Vector3h Wxz { get; set; }
Property Value
Type Description
Vector3h

Wxzy

Gets or sets an OpenTK.Vector4h with the W, X, Z, and Y components of this instance.

Declaration
public Vector4h Wxzy { get; set; }
Property Value
Type Description
Vector4h

Wy

Gets or sets an OpenTK.Vector2h with the W and Y components of this instance.

Declaration
public Vector2h Wy { get; set; }
Property Value
Type Description
Vector2h

Wyx

Gets or sets an OpenTK.Vector3h with the W, Y, and X components of this instance.

Declaration
public Vector3h Wyx { get; set; }
Property Value
Type Description
Vector3h

Wyxz

Gets or sets an OpenTK.Vector4h with the W, Y, X, and Z components of this instance.

Declaration
public Vector4h Wyxz { get; set; }
Property Value
Type Description
Vector4h

Wyz

Gets or sets an OpenTK.Vector3h with the W, Y, and Z components of this instance.

Declaration
public Vector3h Wyz { get; set; }
Property Value
Type Description
Vector3h

Wyzx

Gets or sets an OpenTK.Vector4h with the W, Y, Z, and X components of this instance.

Declaration
public Vector4h Wyzx { get; set; }
Property Value
Type Description
Vector4h

Wz

Gets or sets an OpenTK.Vector2h with the W and Z components of this instance.

Declaration
public Vector2h Wz { get; set; }
Property Value
Type Description
Vector2h

Wzx

Gets or sets an OpenTK.Vector3h with the W, Z, and X components of this instance.

Declaration
public Vector3h Wzx { get; set; }
Property Value
Type Description
Vector3h

Wzxy

Gets or sets an OpenTK.Vector4h with the W, Z, X, and Y components of this instance.

Declaration
public Vector4h Wzxy { get; set; }
Property Value
Type Description
Vector4h

Wzy

Gets or sets an OpenTK.Vector3h with the W, Z, and Y components of this instance.

Declaration
public Vector3h Wzy { get; set; }
Property Value
Type Description
Vector3h

Wzyw

Gets an OpenTK.Vector4h with the W, Z, Y, and W components of this instance.

Declaration
public Vector4h Wzyw { get; set; }
Property Value
Type Description
Vector4h

Wzyx

Gets or sets an OpenTK.Vector4h with the W, Z, Y, and X components of this instance.

Declaration
public Vector4h Wzyx { get; set; }
Property Value
Type Description
Vector4h

Xw

Gets or sets an OpenTK.Vector2h with the X and W components of this instance.

Declaration
public Vector2h Xw { get; set; }
Property Value
Type Description
Vector2h

Xwy

Gets or sets an OpenTK.Vector3h with the X, W, and Y components of this instance.

Declaration
public Vector3h Xwy { get; set; }
Property Value
Type Description
Vector3h

Xwyz

Gets or sets an OpenTK.Vector4h with the X, W, Y, and Z components of this instance.

Declaration
public Vector4h Xwyz { get; set; }
Property Value
Type Description
Vector4h

Xwz

Gets or sets an OpenTK.Vector3h with the X, W, and Z components of this instance.

Declaration
public Vector3h Xwz { get; set; }
Property Value
Type Description
Vector3h

Xwzy

Gets or sets an OpenTK.Vector4h with the X, W, Z, and Y components of this instance.

Declaration
public Vector4h Xwzy { get; set; }
Property Value
Type Description
Vector4h

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

Xyw

Gets or sets an OpenTK.Vector3h with the X, Y, and Z components of this instance.

Declaration
public Vector3h Xyw { get; set; }
Property Value
Type Description
Vector3h

Xywz

Gets or sets an OpenTK.Vector4h with the X, Y, W, and Z components of this instance.

Declaration
public Vector4h Xywz { get; set; }
Property Value
Type Description
Vector4h

Xyz

Gets or sets an OpenTK.Vector3h with the X, Y, and Z components of this instance.

Declaration
public Vector3h Xyz { get; set; }
Property Value
Type Description
Vector3h

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

Xzw

Gets or sets an OpenTK.Vector3h with the X, Z, and W components of this instance.

Declaration
public Vector3h Xzw { get; set; }
Property Value
Type Description
Vector3h

Xzwy

Gets or sets an OpenTK.Vector4h with the X, Z, W, and Y components of this instance.

Declaration
public Vector4h Xzwy { get; set; }
Property Value
Type Description
Vector4h

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

Xzyw

Gets or sets an OpenTK.Vector4h with the X, Z, Y, and W components of this instance.

Declaration
public Vector4h Xzyw { get; set; }
Property Value
Type Description
Vector4h

Yw

Gets or sets an OpenTK.Vector2h with the Y and W components of this instance.

Declaration
public Vector2h Yw { get; set; }
Property Value
Type Description
Vector2h

Ywx

Gets or sets an OpenTK.Vector3h with the Y, W, and X components of this instance.

Declaration
public Vector3h Ywx { get; set; }
Property Value
Type Description
Vector3h

Ywxz

Gets or sets an OpenTK.Vector4h with the Y, W, X, and Z components of this instance.

Declaration
public Vector4h Ywxz { get; set; }
Property Value
Type Description
Vector4h

Ywz

Gets an OpenTK.Vector3h with the Y, W, and Z components of this instance.

Declaration
public Vector3h Ywz { get; set; }
Property Value
Type Description
Vector3h

Ywzx

Gets or sets an OpenTK.Vector4h with the Y, W, Z, and X components of this instance.

Declaration
public Vector4h Ywzx { get; set; }
Property Value
Type Description
Vector4h

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

Yxw

Gets or sets an OpenTK.Vector3h with the Y, X, and W components of this instance.

Declaration
public Vector3h Yxw { get; set; }
Property Value
Type Description
Vector3h

Yxwz

Gets or sets an OpenTK.Vector4h with the Y, X, W, and Z components of this instance.

Declaration
public Vector4h Yxwz { get; set; }
Property Value
Type Description
Vector4h

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

Yxzw

Gets or sets an OpenTK.Vector4h with the Y, X, Z, and W components of this instance.

Declaration
public Vector4h Yxzw { get; set; }
Property Value
Type Description
Vector4h

Yywz

Gets an OpenTK.Vector4h with the Y, Y, W, and Z components of this instance.

Declaration
public Vector4h Yywz { get; set; }
Property Value
Type Description
Vector4h

Yyzw

Gets an OpenTK.Vector4h with the Y, Y, Z, and W components of this instance.

Declaration
public Vector4h Yyzw { get; set; }
Property Value
Type Description
Vector4h

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

Yzw

Gets or sets an OpenTK.Vector3h with the Y, Z, and W components of this instance.

Declaration
public Vector3h Yzw { get; set; }
Property Value
Type Description
Vector3h

Yzwx

Gets or sets an OpenTK.Vector4h with the Y, Z, W, and X components of this instance.

Declaration
public Vector4h Yzwx { get; set; }
Property Value
Type Description
Vector4h

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

Yzxw

Gets or sets an OpenTK.Vector4h with the Y, Z, X, and W components of this instance.

Declaration
public Vector4h Yzxw { get; set; }
Property Value
Type Description
Vector4h

Zw

Gets an OpenTK.Vector2h with the Z and W components of this instance.

Declaration
public Vector2h Zw { get; set; }
Property Value
Type Description
Vector2h

Zwx

Gets or sets an OpenTK.Vector3h with the Z, W, and X components of this instance.

Declaration
public Vector3h Zwx { get; set; }
Property Value
Type Description
Vector3h

Zwxy

Gets or sets an OpenTK.Vector4h with the Z, W, X, and Y components of this instance.

Declaration
public Vector4h Zwxy { get; set; }
Property Value
Type Description
Vector4h

Zwy

Gets or sets an OpenTK.Vector3h with the Z, W, and Y components of this instance.

Declaration
public Vector3h Zwy { get; set; }
Property Value
Type Description
Vector3h

Zwyx

Gets or sets an OpenTK.Vector4h with the Z, W, Y, and X components of this instance.

Declaration
public Vector4h Zwyx { get; set; }
Property Value
Type Description
Vector4h

Zwzy

Gets an OpenTK.Vector4h with the Z, W, Z, and Y components of this instance.

Declaration
public Vector4h Zwzy { get; set; }
Property Value
Type Description
Vector4h

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

Zxw

Gets or sets an OpenTK.Vector3h with the Z, X, and W components of this instance.

Declaration
public Vector3h Zxw { get; set; }
Property Value
Type Description
Vector3h

Zxwy

Gets or sets an OpenTK.Vector4h with the Z, X, W, and Y components of this instance.

Declaration
public Vector4h Zxwy { get; set; }
Property Value
Type Description
Vector4h

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

Zxyw

Gets or sets an OpenTK.Vector4h with the Z, X, Y, and Z components of this instance.

Declaration
public Vector4h Zxyw { get; set; }
Property Value
Type Description
Vector4h

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

Zyw

Gets or sets an OpenTK.Vector3h with the Z, Y, and W components of this instance.

Declaration
public Vector3h Zyw { get; set; }
Property Value
Type Description
Vector3h

Zywx

Gets or sets an OpenTK.Vector4h with the Z, Y, W, and X components of this instance.

Declaration
public Vector4h Zywx { get; set; }
Property Value
Type Description
Vector4h

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

Zyxw

Gets or sets an OpenTK.Vector4h with the Z, Y, X, and W components of this instance.

Declaration
public Vector4h Zyxw { get; set; }
Property Value
Type Description
Vector4h

Methods

Equals(Vector4h)

Returns a value indicating whether this instance is equal to a specified OpenTK.Half4 vector.

Declaration
public bool Equals(Vector4h other)
Parameters
Type Name Description
Vector4h other

OpenTK.Half4 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,Z and W 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 Half4.

Declaration
public static Vector4h FromBytes(byte[] value, int startIndex)
Parameters
Type Name Description
Byte[] value

A Half4 in it's byte[] representation.

Int32 startIndex

The starting position within value.

Returns
Type Description
Vector4h

A new Half4 instance.

GetBytes(Vector4h)

Returns the Half4 as an array of bytes.

Declaration
public static byte[] GetBytes(Vector4h h)
Parameters
Type Name Description
Vector4h h

The Half4 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,Z and W 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 Half4's numbers in human-legible form.

Declaration
public override string ToString()
Returns
Type Description
String
Overrides
ValueType.ToString()

ToVector4()

Returns this Half4 instance's contents as Vector4.

Declaration
public Vector4 ToVector4()
Returns
Type Description
Vector4

OpenTK.Vector4

ToVector4d()

Returns this Half4 instance's contents as Vector4d.

Declaration
public Vector4d ToVector4d()
Returns
Type Description
Vector4d

Operators

Explicit(Vector4 to Vector4h)

Converts OpenTK.Vector4 to OpenTK.Half4.

Declaration
public static explicit operator Vector4h(Vector4 v4f)
Parameters
Type Name Description
Vector4 v4f

The Vector4 to convert.

Returns
Type Description
Vector4h

The resulting Half vector.

Explicit(Vector4d to Vector4h)

Converts OpenTK.Vector4d to OpenTK.Half4.

Declaration
public static explicit operator Vector4h(Vector4d v4d)
Parameters
Type Name Description
Vector4d v4d

The Vector4d to convert.

Returns
Type Description
Vector4h

The resulting Half vector.

Explicit(Vector4h to Vector4)

Converts OpenTK.Half4 to OpenTK.Vector4.

Declaration
public static explicit operator Vector4(Vector4h h4)
Parameters
Type Name Description
Vector4h h4

The Half4 to convert.

Returns
Type Description
Vector4

The resulting Vector4.

Explicit(Vector4h to Vector4d)

Converts OpenTK.Half4 to OpenTK.Vector4d.

Declaration
public static explicit operator Vector4d(Vector4h h4)
Parameters
Type Name Description
Vector4h h4

The Half4 to convert.

Returns
Type Description
Vector4d

The resulting Vector4d.

Implements

System.Runtime.Serialization.ISerializable
System.IEquatable<T>
In This Article
Back to top Generated by DocFX