Vector4 Struct

Definition

Represents a 4D vector using four single-precision floating-point numbers.

[System.Serializable]
public struct Vector4 : IEquatable<OpenTK.Vector4>
type Vector4 = struct
Inheritance
Vector4
Attributes
Implements

Remarks

The Vector4 structure is suitable for interoperation with unmanaged code requiring four consecutive floats.

Constructors

Vector4(Single)
Vector4(Single, Single, Single, Single)

Constructs a new Vector4.

Vector4(Vector2)

Constructs a new Vector4 from the given Vector2.

Vector4(Vector3)

Constructs a new Vector4 from the given Vector3.

Vector4(Vector3, Single)
Vector4(Vector4)

Constructs a new Vector4 from the given Vector4.

Fields

One

Defines an instance with all components set to 1.

SizeInBytes

Defines the size of the Vector4 struct in bytes.

UnitW

Defines a unit-length Vector4 that points towards the W-axis.

UnitX

Defines a unit-length Vector4 that points towards the X-axis.

UnitY

Defines a unit-length Vector4 that points towards the Y-axis.

UnitZ

Defines a unit-length Vector4 that points towards the Z-axis.

W

The Z component of the Vector4.

X

The X component of the Vector4.

Y

The Y component of the Vector4.

Z

The Z component of the Vector4.

Zero

Defines a zero-length Vector4.

Properties

Length

Gets the length (magnitude) of the vector.

LengthFast

Gets an approximation of the vector length (magnitude).

LengthSquared

Gets the square of the vector length (magnitude).

Xy

Gets or sets an OpenTK.Vector2 with the X and Y components of this instance.

Xyz

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

Methods

Add(Vector4)
Obsolete.

Add the Vector passed as parameter to this instance.

Add(Vector4)
Obsolete.

Add the Vector passed as parameter to this instance.

Add(Vector4, Vector4)
Add(Vector4, Vector4, Vector4)

Add two Vectors

BaryCentric(Vector4, Vector4, Vector4, Single, Single)
BaryCentric(Vector4, Vector4, Vector4, Single, Single, Vector4)
Clamp(Vector4, Vector4, Vector4)
Clamp(Vector4, Vector4, Vector4, Vector4)

Clamp a vector to the given minimum and maximum vectors

Div(Single)
Obsolete.

Divide this instance by a scalar.

Div(Vector4, Single)
Div(Vector4, Single, Vector4)
Divide(Vector4, Single)
Divide(Vector4, Single, Vector4)
Divide(Vector4, Vector4)
Divide(Vector4, Vector4, Vector4)
Dot(Vector4, Vector4)

Calculate the dot product of two vectors

Dot(Vector4, Vector4, Single)
Equals(Object)

Indicates whether this instance and a specified object are equal.

Equals(Vector4)

Indicates whether the current vector is equal to another vector.

GetHashCode()

Returns the hashcode for this instance.

Lerp(Vector4, Vector4, Single)
Lerp(Vector4, Vector4, Single, Vector4)
Max(Vector4, Vector4)
Max(Vector4, Vector4, Vector4)

Calculate the component-wise maximum of two vectors

Min(Vector4, Vector4)
Min(Vector4, Vector4, Vector4)

Calculate the component-wise minimum of two vectors

Mult(Single)
Obsolete.

Multiply this instance by a scalar.

Mult(Vector4, Single)
Mult(Vector4, Single, Vector4)
Multiply(Vector4, Single)
Multiply(Vector4, Single, Vector4)
Multiply(Vector4, Vector4)
Multiply(Vector4, Vector4, Vector4)
Normalize()

Scales the Vector4 to unit length.

Normalize(Vector4)
Normalize(Vector4, Vector4)

Scale a vector to unit length

NormalizeFast()

Scales the Vector4 to approximately unit length.

NormalizeFast(Vector4)
NormalizeFast(Vector4, Vector4)

Scale a vector to approximately unit length

Scale(Single, Single, Single, Single)
Obsolete.

Scales the current Vector4 by the given amounts.

Scale(Vector4)
Obsolete.

Scales this instance by the given parameter.

Scale(Vector4)
Obsolete.

Scales this instance by the given parameter.

Sub(Vector4)
Obsolete.

Subtract the Vector passed as parameter from this instance.

Sub(Vector4)
Obsolete.

Subtract the Vector passed as parameter from this instance.

Sub(Vector4, Vector4)
Sub(Vector4, Vector4, Vector4)

Subtract one Vector from another

Subtract(Vector4, Vector4)
Subtract(Vector4, Vector4, Vector4)
ToString()

Returns a System.String that represents the current Vector4.

Transform(Vector4, Matrix4)
Transform(Vector4, Matrix4, Vector4)

Transform a Vector by the given Matrix

Transform(Vector4, Quaternion)
Transform(Vector4, Quaternion, Vector4)

Operators

Addition(Vector4, Vector4)
Division(Vector4, Single)
Equality(Vector4, Vector4)
Explicit(Vector4 to IntPtr)
Explicit(Vector4 to Single*)
Inequality(Vector4, Vector4)
Multiply(Single, Vector4)
Multiply(Vector4, Single)
Subtraction(Vector4, Vector4)
UnaryNegation(Vector4)

Applies to