Vector4 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
Vector4Vector4
Attributes
Implements

Remarks

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

Constructors

Vector4(Vector2) Vector4(Vector2)

Constructs a new Vector4 from the given Vector2.

Vector4(Vector3) Vector4(Vector3)

Constructs a new Vector4 from the given Vector3.

Vector4(Vector4) Vector4(Vector4)

Constructs a new Vector4 from the given Vector4.

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

Constructs a new Vector4.

Fields

One One

Defines an instance with all components set to 1.

SizeInBytes SizeInBytes

Defines the size of the Vector4 struct in bytes.

UnitW UnitW

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

UnitX UnitX

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

UnitY UnitY

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

UnitZ UnitZ

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

W W

The Z component of the Vector4.

X X

The X component of the Vector4.

Y Y

The Y component of the Vector4.

Z Z

The Z component of the Vector4.

Zero Zero

Defines a zero-length Vector4.

Properties

Length Length

Gets the length (magnitude) of the vector.

LengthFast LengthFast

Gets an approximation of the vector length (magnitude).

LengthSquared LengthSquared

Gets the square of the vector length (magnitude).

Xy Xy

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

Xyz Xyz

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

Methods

Add(Vector4) Add(Vector4)

Add the Vector passed as parameter to this instance.

Add(Vector4) Add(Vector4)

Add the Vector passed as parameter to this instance.

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

Add two Vectors

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

Clamp a vector to the given minimum and maximum vectors

Div(Single) Div(Single)

Divide this instance by a scalar.

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

Calculate the dot product of two vectors

Equals(Vector4) Equals(Vector4)

Indicates whether the current vector is equal to another vector.

Equals(Object) Equals(Object)

Indicates whether this instance and a specified object are equal.

GetHashCode() GetHashCode()

Returns the hashcode for this instance.

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

Calculate the component-wise maximum of two vectors

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

Calculate the component-wise minimum of two vectors

Mult(Single) Mult(Single)

Multiply this instance by a scalar.

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

Scale a vector to unit length

Normalize() Normalize()

Scales the Vector4 to unit length.

Normalize(Vector4) Normalize(Vector4)
NormalizeFast() NormalizeFast()

Scales the Vector4 to approximately unit length.

NormalizeFast(Vector4) NormalizeFast(Vector4)
NormalizeFast(Vector4, Vector4) NormalizeFast(Vector4, Vector4)

Scale a vector to approximately unit length

Scale(Vector4) Scale(Vector4)

Scales this instance by the given parameter.

Scale(Vector4) Scale(Vector4)

Scales this instance by the given parameter.

Scale(Single, Single, Single, Single) Scale(Single, Single, Single, Single)

Scales the current Vector4 by the given amounts.

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

Subtract one Vector from another

Sub(Vector4) Sub(Vector4)

Subtract the Vector passed as parameter from this instance.

Sub(Vector4) Sub(Vector4)

Subtract the Vector passed as parameter from this instance.

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

Returns a System.String that represents the current Vector4.

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

Transform a Vector by the given Matrix

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

Operators

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

Applies to