Show / Hide Table of Contents

Struct Vector4h

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

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

Constructors

Vector4h(Vector2h, Half, Half)

Initializes a new instance of the Vector4h struct.

Declaration
public Vector4h(Vector2h xy, Half z = default, Half w = default)
Parameters
Type Name Description
Vector2h xy

The x and y components of the Vector4h.

Half z

The z component of the Vector4h.

Half w

The w component of the Vector4h.

Vector4h(Vector2h, float, float)

Initializes a new instance of the Vector4h struct.

Declaration
public Vector4h(Vector2h xy, float z = 0, float w = 0)
Parameters
Type Name Description
Vector2h xy

The x and y components of the Vector4h.

float z

The z component of the Vector4h.

float w

The w component of the Vector4h.

Vector4h(Vector3h, Half)

Initializes a new instance of the Vector4h struct.

Declaration
public Vector4h(Vector3h xyz, Half w = default)
Parameters
Type Name Description
Vector3h xyz

The x, y and z components of the Vector4h.

Half w

The w component of the Vector4h.

Vector4h(Vector3h, float)

Initializes a new instance of the Vector4h struct.

Declaration
public Vector4h(Vector3h xyz, float w = 0)
Parameters
Type Name Description
Vector3h xyz

The x, y and z components of the Vector4h.

float w

The w component of the Vector4h.

Vector4h(Half)

Initializes a new instance of the Vector4h struct.

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

The value that will initialize this instance.

Vector4h(Half, Half, Half, Half)

Initializes a new instance of the Vector4h struct.

Declaration
public Vector4h(Half x, Half y, Half z, Half w)
Parameters
Type Name Description
Half x

The x component of the Vector4h.

Half y

The y component of the Vector4h.

Half z

The z component of the Vector4h.

Half w

The w component of the Vector4h.

Vector4h(SerializationInfo, StreamingContext)

Initializes a new instance of the Vector4h struct.

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

The serialization info.

StreamingContext context

The streaming context.

Vector4h(float)

Initializes a new instance of the Vector4h struct.

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

The value that will initialize this instance.

Vector4h(float, float, float, float)

Initializes a new instance of the Vector4h struct.

Declaration
public Vector4h(float x, float y, float z, float w)
Parameters
Type Name Description
float x

The x component of the Vector4h.

float y

The y component of the Vector4h.

float z

The z component of the Vector4h.

float w

The w component of the Vector4h.

Fields

SizeInBytes

Defines the size of the Vector4d struct in bytes.

Declaration
public static readonly int SizeInBytes
Field Value
Type Description
int

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 { readonly 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 { readonly 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 { readonly 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 { readonly 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 { readonly 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 { readonly 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 { readonly 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 { readonly 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 { readonly 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 { readonly 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 { readonly 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 { readonly 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 { readonly 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 { readonly get; set; }
Property Value
Type Description
Vector3h

Wzyw

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

Declaration
public Vector4h Wzyw { readonly 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 { readonly 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 { readonly 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 { readonly 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 { readonly 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 { readonly 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 { readonly 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 { readonly 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 { readonly 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 { readonly 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 { readonly 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 { readonly 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 { readonly 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 { readonly 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 { readonly 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 { readonly 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 { readonly get; set; }
Property Value
Type Description
Vector4h

Ywz

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

Declaration
public Vector3h Ywz { readonly 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 { readonly 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 { readonly 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 { readonly 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 { readonly 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 { readonly 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 { readonly get; set; }
Property Value
Type Description
Vector4h

Yywz

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

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

Yyzw

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

Declaration
public Vector4h Yyzw { readonly 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 { readonly 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 { readonly 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 { readonly 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 { readonly 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 { readonly get; set; }
Property Value
Type Description
Vector4h

Zw

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

Declaration
public Vector2h Zw { readonly 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 { readonly 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 { readonly 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 { readonly 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 { readonly get; set; }
Property Value
Type Description
Vector4h

Zwzy

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

Declaration
public Vector4h Zwzy { readonly 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 { readonly 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 { readonly 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 { readonly 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 { readonly 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 { readonly 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 { readonly 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 { readonly 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 { readonly 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 { readonly 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 { readonly get; set; }
Property Value
Type Description
Vector4h

Methods

Deconstruct(out Half, 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, out Half w)
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.

Half w

The W component of the vector.

Equals(Vector4h)

Indicates whether the current object is equal to another object of the same type.

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

An object to compare with this object.

Returns
Type Description
bool

true if the current object is equal to the other parameter; otherwise, false.

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 obj and this instance are the same type and represent the same value; otherwise, false.

Overrides
ValueType.Equals(object)

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
ValueType.GetHashCode()

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
ValueType.ToString()

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 (Nothing in Visual Basic) to obtain the numeric format information from the current locale setting of the operating system.

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 (Nothing in Visual Basic) to use the default format defined for the type of the IFormattable implementation.

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 (Nothing in Visual Basic) to use the default format defined for the type of the IFormattable implementation.

IFormatProvider formatProvider

The provider to use to format the value.

-or-

A null reference (Nothing in Visual Basic) to obtain the numeric format information from the current locale setting of the operating system.

Returns
Type Description
string

The value of the current instance in the specified format.

ToVector4()

Returns this Half4 instance's contents as Vector4.

Declaration
public readonly Vector4 ToVector4()
Returns
Type Description
Vector4

The vector.

ToVector4d()

Returns this Half4 instance's contents as Vector4d.

Declaration
public readonly Vector4d ToVector4d()
Returns
Type Description
Vector4d

The vector.

Operators

operator ==(Vector4h, Vector4h)

Compares two instances for equality.

Declaration
public static bool operator ==(Vector4h left, Vector4h right)
Parameters
Type Name Description
Vector4h left

The first instance.

Vector4h right

The second instance.

Returns
Type Description
bool

True, if left equals right; false otherwise.

explicit operator Vector4i(Vector4h)

Converts OpenTK.Vector4h to OpenTK.Vector4i.

Declaration
[Pure]
public static explicit operator Vector4i(Vector4h vec)
Parameters
Type Name Description
Vector4h vec

The Vector4h to convert.

Returns
Type Description
Vector4i

The resulting Vector4i.

implicit operator Vector4(Vector4h)

Converts OpenTK.Vector4h to OpenTK.Vector4.

Declaration
[Pure]
public static implicit operator Vector4(Vector4h vec)
Parameters
Type Name Description
Vector4h vec

The Vector4h to convert.

Returns
Type Description
Vector4

The resulting Vector4.

implicit operator Vector4d(Vector4h)

Converts OpenTK.Vector4h to OpenTK.Vector4d.

Declaration
[Pure]
public static implicit operator Vector4d(Vector4h vec)
Parameters
Type Name Description
Vector4h vec

The Vector4h to convert.

Returns
Type Description
Vector4d

The resulting Vector4d.

implicit operator Vector4h((Half X, Half Y, Half Z, Half W))

Initializes a new instance of the Vector4h struct using a tuple containing the component values.

Declaration
[Pure]
public static implicit operator Vector4h((Half X, Half Y, Half Z, Half W) values)
Parameters
Type Name Description
(Half X, Half Y, Half Z, Half W) values

A tuple containing the component values.

Returns
Type Description
Vector4h

A new instance of the Vector4h struct with the given component values.

operator !=(Vector4h, Vector4h)

Compares two instances for inequality.

Declaration
public static bool operator !=(Vector4h left, Vector4h right)
Parameters
Type Name Description
Vector4h left

The first instance.

Vector4h right

The second instance.

Returns
Type Description
bool

True, if left does not equa lright; false otherwise.

Implements

ISerializable
IEquatable<T>
IFormattable
In this article
Back to top Generated by DocFX