The Open Toolkit library  1.1
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Properties | List of all members
OpenTK.Vector4 Struct Reference

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

Inherits IEquatable< Vector4 >.

Public Member Functions

 Vector4 (float value)
 Constructs a new instance. More...
 
 Vector4 (float x, float y, float z, float w)
 Constructs a new Vector4. More...
 
 Vector4 (Vector2 v)
 Constructs a new Vector4 from the given Vector2. More...
 
 Vector4 (Vector3 v)
 Constructs a new Vector4 from the given Vector3. The w component is initialized to 0. More...
 
 Vector4 (Vector3 v, float w)
 Constructs a new Vector4 from the specified Vector3 and w component. More...
 
 Vector4 (Vector4 v)
 Constructs a new Vector4 from the given Vector4. More...
 
void Add (Vector4 right)
 Add the Vector passed as parameter to this instance. More...
 
void Add (ref Vector4 right)
 Add the Vector passed as parameter to this instance. More...
 
void Sub (Vector4 right)
 Subtract the Vector passed as parameter from this instance. More...
 
void Sub (ref Vector4 right)
 Subtract the Vector passed as parameter from this instance. More...
 
void Mult (float f)
 Multiply this instance by a scalar. More...
 
void Div (float f)
 Divide this instance by a scalar. More...
 
Vector4 Normalized ()
 Returns a copy of the Vector4 scaled to unit length. More...
 
void Normalize ()
 Scales the Vector4 to unit length. More...
 
void NormalizeFast ()
 Scales the Vector4 to approximately unit length. More...
 
void Scale (float sx, float sy, float sz, float sw)
 Scales the current Vector4 by the given amounts. More...
 
void Scale (Vector4 scale)
 Scales this instance by the given parameter. More...
 
void Scale (ref Vector4 scale)
 Scales this instance by the given parameter. More...
 
override string ToString ()
 Returns a System.String that represents the current Vector4. More...
 
override int GetHashCode ()
 Returns the hashcode for this instance. More...
 
override bool Equals (object obj)
 Indicates whether this instance and a specified object are equal. More...
 
bool Equals (Vector4 other)
 Indicates whether the current vector is equal to another vector. More...
 

Static Public Member Functions

static Vector4 Sub (Vector4 a, Vector4 b)
 Subtract one Vector from another More...
 
static void Sub (ref Vector4 a, ref Vector4 b, out Vector4 result)
 Subtract one Vector from another More...
 
static Vector4 Mult (Vector4 a, float f)
 Multiply a vector and a scalar More...
 
static void Mult (ref Vector4 a, float f, out Vector4 result)
 Multiply a vector and a scalar More...
 
static Vector4 Div (Vector4 a, float f)
 Divide a vector by a scalar More...
 
static void Div (ref Vector4 a, float f, out Vector4 result)
 Divide a vector by a scalar More...
 
static Vector4 Add (Vector4 a, Vector4 b)
 Adds two vectors. More...
 
static void Add (ref Vector4 a, ref Vector4 b, out Vector4 result)
 Adds two vectors. More...
 
static Vector4 Subtract (Vector4 a, Vector4 b)
 Subtract one Vector from another More...
 
static void Subtract (ref Vector4 a, ref Vector4 b, out Vector4 result)
 Subtract one Vector from another More...
 
static Vector4 Multiply (Vector4 vector, float scale)
 Multiplies a vector by a scalar. More...
 
static void Multiply (ref Vector4 vector, float scale, out Vector4 result)
 Multiplies a vector by a scalar. More...
 
static Vector4 Multiply (Vector4 vector, Vector4 scale)
 Multiplies a vector by the components a vector (scale). More...
 
static void Multiply (ref Vector4 vector, ref Vector4 scale, out Vector4 result)
 Multiplies a vector by the components of a vector (scale). More...
 
static Vector4 Divide (Vector4 vector, float scale)
 Divides a vector by a scalar. More...
 
static void Divide (ref Vector4 vector, float scale, out Vector4 result)
 Divides a vector by a scalar. More...
 
static Vector4 Divide (Vector4 vector, Vector4 scale)
 Divides a vector by the components of a vector (scale). More...
 
static void Divide (ref Vector4 vector, ref Vector4 scale, out Vector4 result)
 Divide a vector by the components of a vector (scale). More...
 
static Vector4 Min (Vector4 a, Vector4 b)
 Calculate the component-wise minimum of two vectors More...
 
static void Min (ref Vector4 a, ref Vector4 b, out Vector4 result)
 Calculate the component-wise minimum of two vectors More...
 
static Vector4 Max (Vector4 a, Vector4 b)
 Calculate the component-wise maximum of two vectors More...
 
static void Max (ref Vector4 a, ref Vector4 b, out Vector4 result)
 Calculate the component-wise maximum of two vectors More...
 
static Vector4 Clamp (Vector4 vec, Vector4 min, Vector4 max)
 Clamp a vector to the given minimum and maximum vectors More...
 
static void Clamp (ref Vector4 vec, ref Vector4 min, ref Vector4 max, out Vector4 result)
 Clamp a vector to the given minimum and maximum vectors More...
 
static Vector4 Normalize (Vector4 vec)
 Scale a vector to unit length More...
 
static void Normalize (ref Vector4 vec, out Vector4 result)
 Scale a vector to unit length More...
 
static Vector4 NormalizeFast (Vector4 vec)
 Scale a vector to approximately unit length More...
 
static void NormalizeFast (ref Vector4 vec, out Vector4 result)
 Scale a vector to approximately unit length More...
 
static float Dot (Vector4 left, Vector4 right)
 Calculate the dot product of two vectors More...
 
static void Dot (ref Vector4 left, ref Vector4 right, out float result)
 Calculate the dot product of two vectors More...
 
static Vector4 Lerp (Vector4 a, Vector4 b, float blend)
 Returns a new Vector that is the linear blend of the 2 given Vectors More...
 
static void Lerp (ref Vector4 a, ref Vector4 b, float blend, out Vector4 result)
 Returns a new Vector that is the linear blend of the 2 given Vectors More...
 
static Vector4 BaryCentric (Vector4 a, Vector4 b, Vector4 c, float u, float v)
 Interpolate 3 Vectors using Barycentric coordinates More...
 
static void BaryCentric (ref Vector4 a, ref Vector4 b, ref Vector4 c, float u, float v, out Vector4 result)
 Interpolate 3 Vectors using Barycentric coordinates More...
 
static Vector4 Transform (Vector4 vec, Matrix4 mat)
 Transform a Vector by the given Matrix More...
 
static void Transform (ref Vector4 vec, ref Matrix4 mat, out Vector4 result)
 Transform a Vector by the given Matrix More...
 
static Vector4 Transform (Vector4 vec, Quaternion quat)
 Transforms a vector by a quaternion rotation. More...
 
static void Transform (ref Vector4 vec, ref Quaternion quat, out Vector4 result)
 Transforms a vector by a quaternion rotation. More...
 
static Vector4 operator+ (Vector4 left, Vector4 right)
 Adds two instances. More...
 
static Vector4 operator- (Vector4 left, Vector4 right)
 Subtracts two instances. More...
 
static Vector4 operator- (Vector4 vec)
 Negates an instance. More...
 
static Vector4 operator* (Vector4 vec, float scale)
 Multiplies an instance by a scalar. More...
 
static Vector4 operator* (float scale, Vector4 vec)
 Multiplies an instance by a scalar. More...
 
static Vector4 operator/ (Vector4 vec, float scale)
 Divides an instance by a scalar. More...
 
static bool operator== (Vector4 left, Vector4 right)
 Compares two instances for equality. More...
 
static bool operator!= (Vector4 left, Vector4 right)
 Compares two instances for inequality. More...
 
unsafe static operator float * (Vector4 v)
 Returns a pointer to the first element of the specified instance. More...
 
static operator IntPtr (Vector4 v)
 Returns a pointer to the first element of the specified instance. More...
 

Public Attributes

float X
 The X component of the Vector4. More...
 
float Y
 The Y component of the Vector4. More...
 
float Z
 The Z component of the Vector4. More...
 
float W
 The W component of the Vector4. More...
 

Static Public Attributes

static readonly Vector4 UnitX = new Vector4(1, 0, 0, 0)
 Defines a unit-length Vector4 that points towards the X-axis. More...
 
static readonly Vector4 UnitY = new Vector4(0, 1, 0, 0)
 Defines a unit-length Vector4 that points towards the Y-axis. More...
 
static readonly Vector4 UnitZ = new Vector4(0, 0, 1, 0)
 Defines a unit-length Vector4 that points towards the Z-axis. More...
 
static readonly Vector4 UnitW = new Vector4(0, 0, 0, 1)
 Defines a unit-length Vector4 that points towards the W-axis. More...
 
static readonly Vector4 Zero = new Vector4(0, 0, 0, 0)
 Defines a zero-length Vector4. More...
 
static readonly Vector4 One = new Vector4(1, 1, 1, 1)
 Defines an instance with all components set to 1. More...
 
static readonly int SizeInBytes = Marshal.SizeOf(new Vector4())
 Defines the size of the Vector4 struct in bytes. More...
 

Properties

float this[int index] [get, set]
 Gets or sets the value at the index of the Vector. More...
 
float Length [get]
 Gets the length (magnitude) of the vector. More...
 
float LengthFast [get]
 Gets an approximation of the vector length (magnitude). More...
 
float LengthSquared [get]
 Gets the square of the vector length (magnitude). More...
 
Vector2 Xy [get, set]
 Gets or sets an OpenTK.Vector2 with the X and Y components of this instance. More...
 
Vector2 Xz [get, set]
 Gets or sets an OpenTK.Vector2 with the X and Z components of this instance. More...
 
Vector2 Xw [get, set]
 Gets or sets an OpenTK.Vector2 with the X and W components of this instance. More...
 
Vector2 Yx [get, set]
 Gets or sets an OpenTK.Vector2 with the Y and X components of this instance. More...
 
Vector2 Yz [get, set]
 Gets or sets an OpenTK.Vector2 with the Y and Z components of this instance. More...
 
Vector2 Yw [get, set]
 Gets or sets an OpenTK.Vector2 with the Y and W components of this instance. More...
 
Vector2 Zx [get, set]
 Gets or sets an OpenTK.Vector2 with the Z and X components of this instance. More...
 
Vector2 Zy [get, set]
 Gets or sets an OpenTK.Vector2 with the Z and Y components of this instance. More...
 
Vector2 Zw [get, set]
 Gets an OpenTK.Vector2 with the Z and W components of this instance. More...
 
Vector2 Wx [get, set]
 Gets or sets an OpenTK.Vector2 with the W and X components of this instance. More...
 
Vector2 Wy [get, set]
 Gets or sets an OpenTK.Vector2 with the W and Y components of this instance. More...
 
Vector2 Wz [get, set]
 Gets or sets an OpenTK.Vector2 with the W and Z components of this instance. More...
 
Vector3 Xyz [get, set]
 Gets or sets an OpenTK.Vector3 with the X, Y, and Z components of this instance. More...
 
Vector3 Xyw [get, set]
 Gets or sets an OpenTK.Vector3 with the X, Y, and Z components of this instance. More...
 
Vector3 Xzy [get, set]
 Gets or sets an OpenTK.Vector3 with the X, Z, and Y components of this instance. More...
 
Vector3 Xzw [get, set]
 Gets or sets an OpenTK.Vector3 with the X, Z, and W components of this instance. More...
 
Vector3 Xwy [get, set]
 Gets or sets an OpenTK.Vector3 with the X, W, and Y components of this instance. More...
 
Vector3 Xwz [get, set]
 Gets or sets an OpenTK.Vector3 with the X, W, and Z components of this instance. More...
 
Vector3 Yxz [get, set]
 Gets or sets an OpenTK.Vector3 with the Y, X, and Z components of this instance. More...
 
Vector3 Yxw [get, set]
 Gets or sets an OpenTK.Vector3 with the Y, X, and W components of this instance. More...
 
Vector3 Yzx [get, set]
 Gets or sets an OpenTK.Vector3 with the Y, Z, and X components of this instance. More...
 
Vector3 Yzw [get, set]
 Gets or sets an OpenTK.Vector3 with the Y, Z, and W components of this instance. More...
 
Vector3 Ywx [get, set]
 Gets or sets an OpenTK.Vector3 with the Y, W, and X components of this instance. More...
 
Vector3 Ywz [get, set]
 Gets an OpenTK.Vector3 with the Y, W, and Z components of this instance. More...
 
Vector3 Zxy [get, set]
 Gets or sets an OpenTK.Vector3 with the Z, X, and Y components of this instance. More...
 
Vector3 Zxw [get, set]
 Gets or sets an OpenTK.Vector3 with the Z, X, and W components of this instance. More...
 
Vector3 Zyx [get, set]
 Gets or sets an OpenTK.Vector3 with the Z, Y, and X components of this instance. More...
 
Vector3 Zyw [get, set]
 Gets or sets an OpenTK.Vector3 with the Z, Y, and W components of this instance. More...
 
Vector3 Zwx [get, set]
 Gets or sets an OpenTK.Vector3 with the Z, W, and X components of this instance. More...
 
Vector3 Zwy [get, set]
 Gets or sets an OpenTK.Vector3 with the Z, W, and Y components of this instance. More...
 
Vector3 Wxy [get, set]
 Gets or sets an OpenTK.Vector3 with the W, X, and Y components of this instance. More...
 
Vector3 Wxz [get, set]
 Gets or sets an OpenTK.Vector3 with the W, X, and Z components of this instance. More...
 
Vector3 Wyx [get, set]
 Gets or sets an OpenTK.Vector3 with the W, Y, and X components of this instance. More...
 
Vector3 Wyz [get, set]
 Gets or sets an OpenTK.Vector3 with the W, Y, and Z components of this instance. More...
 
Vector3 Wzx [get, set]
 Gets or sets an OpenTK.Vector3 with the W, Z, and X components of this instance. More...
 
Vector3 Wzy [get, set]
 Gets or sets an OpenTK.Vector3 with the W, Z, and Y components of this instance. More...
 
Vector4 Xywz [get, set]
 Gets or sets an OpenTK.Vector4 with the X, Y, W, and Z components of this instance. More...
 
Vector4 Xzyw [get, set]
 Gets or sets an OpenTK.Vector4 with the X, Z, Y, and W components of this instance. More...
 
Vector4 Xzwy [get, set]
 Gets or sets an OpenTK.Vector4 with the X, Z, W, and Y components of this instance. More...
 
Vector4 Xwyz [get, set]
 Gets or sets an OpenTK.Vector4 with the X, W, Y, and Z components of this instance. More...
 
Vector4 Xwzy [get, set]
 Gets or sets an OpenTK.Vector4 with the X, W, Z, and Y components of this instance. More...
 
Vector4 Yxzw [get, set]
 Gets or sets an OpenTK.Vector4 with the Y, X, Z, and W components of this instance. More...
 
Vector4 Yxwz [get, set]
 Gets or sets an OpenTK.Vector4 with the Y, X, W, and Z components of this instance. More...
 
Vector4 Yyzw [get, set]
 Gets an OpenTK.Vector4 with the Y, Y, Z, and W components of this instance. More...
 
Vector4 Yywz [get, set]
 Gets an OpenTK.Vector4 with the Y, Y, W, and Z components of this instance. More...
 
Vector4 Yzxw [get, set]
 Gets or sets an OpenTK.Vector4 with the Y, Z, X, and W components of this instance. More...
 
Vector4 Yzwx [get, set]
 Gets or sets an OpenTK.Vector4 with the Y, Z, W, and X components of this instance. More...
 
Vector4 Ywxz [get, set]
 Gets or sets an OpenTK.Vector4 with the Y, W, X, and Z components of this instance. More...
 
Vector4 Ywzx [get, set]
 Gets or sets an OpenTK.Vector4 with the Y, W, Z, and X components of this instance. More...
 
Vector4 Zxyw [get, set]
 Gets or sets an OpenTK.Vector4 with the Z, X, Y, and Z components of this instance. More...
 
Vector4 Zxwy [get, set]
 Gets or sets an OpenTK.Vector4 with the Z, X, W, and Y components of this instance. More...
 
Vector4 Zyxw [get, set]
 Gets or sets an OpenTK.Vector4 with the Z, Y, X, and W components of this instance. More...
 
Vector4 Zywx [get, set]
 Gets or sets an OpenTK.Vector4 with the Z, Y, W, and X components of this instance. More...
 
Vector4 Zwxy [get, set]
 Gets or sets an OpenTK.Vector4 with the Z, W, X, and Y components of this instance. More...
 
Vector4 Zwyx [get, set]
 Gets or sets an OpenTK.Vector4 with the Z, W, Y, and X components of this instance. More...
 
Vector4 Zwzy [get, set]
 Gets an OpenTK.Vector4 with the Z, W, Z, and Y components of this instance. More...
 
Vector4 Wxyz [get, set]
 Gets or sets an OpenTK.Vector4 with the W, X, Y, and Z components of this instance. More...
 
Vector4 Wxzy [get, set]
 Gets or sets an OpenTK.Vector4 with the W, X, Z, and Y components of this instance. More...
 
Vector4 Wyxz [get, set]
 Gets or sets an OpenTK.Vector4 with the W, Y, X, and Z components of this instance. More...
 
Vector4 Wyzx [get, set]
 Gets or sets an OpenTK.Vector4 with the W, Y, Z, and X components of this instance. More...
 
Vector4 Wzxy [get, set]
 Gets or sets an OpenTK.Vector4 with the W, Z, X, and Y components of this instance. More...
 
Vector4 Wzyx [get, set]
 Gets or sets an OpenTK.Vector4 with the W, Z, Y, and X components of this instance. More...
 
Vector4 Wzyw [get, set]
 Gets an OpenTK.Vector4 with the W, Z, Y, and W components of this instance. More...
 

Detailed Description

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

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

Constructor & Destructor Documentation

OpenTK.Vector4.Vector4 ( float  value)

Constructs a new instance.

Parameters
valueThe value that will initialize this instance.
OpenTK.Vector4.Vector4 ( float  x,
float  y,
float  z,
float  w 
)

Constructs a new Vector4.

Parameters
xThe x component of the Vector4.
yThe y component of the Vector4.
zThe z component of the Vector4.
wThe w component of the Vector4.
OpenTK.Vector4.Vector4 ( Vector2  v)

Constructs a new Vector4 from the given Vector2.

Parameters
vThe Vector2 to copy components from.
OpenTK.Vector4.Vector4 ( Vector3  v)

Constructs a new Vector4 from the given Vector3. The w component is initialized to 0.

Parameters
vThe Vector3 to copy components from.
See Also
Vector4(Vector3, float)
OpenTK.Vector4.Vector4 ( Vector3  v,
float  w 
)

Constructs a new Vector4 from the specified Vector3 and w component.

Parameters
vThe Vector3 to copy components from.
wThe w component of the new Vector4.
OpenTK.Vector4.Vector4 ( Vector4  v)

Constructs a new Vector4 from the given Vector4.

Parameters
vThe Vector4 to copy components from.

Member Function Documentation

void OpenTK.Vector4.Add ( Vector4  right)

Add the Vector passed as parameter to this instance.

Parameters
rightRight operand. This parameter is only read from.
void OpenTK.Vector4.Add ( ref Vector4  right)

Add the Vector passed as parameter to this instance.

Parameters
rightRight operand. This parameter is only read from.
static Vector4 OpenTK.Vector4.Add ( Vector4  a,
Vector4  b 
)
static

Adds two vectors.

Parameters
aLeft operand.
bRight operand.
Returns
Result of operation.
static void OpenTK.Vector4.Add ( ref Vector4  a,
ref Vector4  b,
out Vector4  result 
)
static

Adds two vectors.

Parameters
aLeft operand.
bRight operand.
resultResult of operation.
static Vector4 OpenTK.Vector4.BaryCentric ( Vector4  a,
Vector4  b,
Vector4  c,
float  u,
float  v 
)
static

Interpolate 3 Vectors using Barycentric coordinates

Parameters
aFirst input Vector
bSecond input Vector
cThird input Vector
uFirst Barycentric Coordinate
vSecond Barycentric Coordinate
Returns
a when u=v=0, b when u=1,v=0, c when u=0,v=1, and a linear combination of a,b,c otherwise
static void OpenTK.Vector4.BaryCentric ( ref Vector4  a,
ref Vector4  b,
ref Vector4  c,
float  u,
float  v,
out Vector4  result 
)
static

Interpolate 3 Vectors using Barycentric coordinates

Parameters
aFirst input Vector.
bSecond input Vector.
cThird input Vector.
uFirst Barycentric Coordinate.
vSecond Barycentric Coordinate.
resultOutput Vector. a when u=v=0, b when u=1,v=0, c when u=0,v=1, and a linear combination of a,b,c otherwise
static Vector4 OpenTK.Vector4.Clamp ( Vector4  vec,
Vector4  min,
Vector4  max 
)
static

Clamp a vector to the given minimum and maximum vectors

Parameters
vecInput vector
minMinimum vector
maxMaximum vector
Returns
The clamped vector
static void OpenTK.Vector4.Clamp ( ref Vector4  vec,
ref Vector4  min,
ref Vector4  max,
out Vector4  result 
)
static

Clamp a vector to the given minimum and maximum vectors

Parameters
vecInput vector
minMinimum vector
maxMaximum vector
resultThe clamped vector
void OpenTK.Vector4.Div ( float  f)

Divide this instance by a scalar.

Parameters
fScalar operand.
static Vector4 OpenTK.Vector4.Div ( Vector4  a,
float  f 
)
static

Divide a vector by a scalar

Parameters
aVector operand
fScalar operand
Returns
Result of the division
static void OpenTK.Vector4.Div ( ref Vector4  a,
float  f,
out Vector4  result 
)
static

Divide a vector by a scalar

Parameters
aVector operand
fScalar operand
resultResult of the division
static Vector4 OpenTK.Vector4.Divide ( Vector4  vector,
float  scale 
)
static

Divides a vector by a scalar.

Parameters
vectorLeft operand.
scaleRight operand.
Returns
Result of the operation.
static void OpenTK.Vector4.Divide ( ref Vector4  vector,
float  scale,
out Vector4  result 
)
static

Divides a vector by a scalar.

Parameters
vectorLeft operand.
scaleRight operand.
resultResult of the operation.
static Vector4 OpenTK.Vector4.Divide ( Vector4  vector,
Vector4  scale 
)
static

Divides a vector by the components of a vector (scale).

Parameters
vectorLeft operand.
scaleRight operand.
Returns
Result of the operation.
static void OpenTK.Vector4.Divide ( ref Vector4  vector,
ref Vector4  scale,
out Vector4  result 
)
static

Divide a vector by the components of a vector (scale).

Parameters
vectorLeft operand.
scaleRight operand.
resultResult of the operation.
static float OpenTK.Vector4.Dot ( Vector4  left,
Vector4  right 
)
static

Calculate the dot product of two vectors

Parameters
leftFirst operand
rightSecond operand
Returns
The dot product of the two inputs
static void OpenTK.Vector4.Dot ( ref Vector4  left,
ref Vector4  right,
out float  result 
)
static

Calculate the dot product of two vectors

Parameters
leftFirst operand
rightSecond operand
resultThe dot product of the two inputs
override bool OpenTK.Vector4.Equals ( object  obj)

Indicates whether this instance and a specified object are equal.

Parameters
objThe object to compare to.
Returns
True if the instances are equal; false otherwise.
bool OpenTK.Vector4.Equals ( Vector4  other)

Indicates whether the current vector is equal to another vector.

Parameters
otherA vector to compare with this vector.
Returns
true if the current vector is equal to the vector parameter; otherwise, false.
override int OpenTK.Vector4.GetHashCode ( )

Returns the hashcode for this instance.

Returns
A System.Int32 containing the unique hashcode for this instance.
static Vector4 OpenTK.Vector4.Lerp ( Vector4  a,
Vector4  b,
float  blend 
)
static

Returns a new Vector that is the linear blend of the 2 given Vectors

Parameters
aFirst input vector
bSecond input vector
blendThe blend factor. a when blend=0, b when blend=1.
Returns
a when blend=0, b when blend=1, and a linear combination otherwise
static void OpenTK.Vector4.Lerp ( ref Vector4  a,
ref Vector4  b,
float  blend,
out Vector4  result 
)
static

Returns a new Vector that is the linear blend of the 2 given Vectors

Parameters
aFirst input vector
bSecond input vector
blendThe blend factor. a when blend=0, b when blend=1.
resulta when blend=0, b when blend=1, and a linear combination otherwise
static Vector4 OpenTK.Vector4.Max ( Vector4  a,
Vector4  b 
)
static

Calculate the component-wise maximum of two vectors

Parameters
aFirst operand
bSecond operand
Returns
The component-wise maximum
static void OpenTK.Vector4.Max ( ref Vector4  a,
ref Vector4  b,
out Vector4  result 
)
static

Calculate the component-wise maximum of two vectors

Parameters
aFirst operand
bSecond operand
resultThe component-wise maximum
static Vector4 OpenTK.Vector4.Min ( Vector4  a,
Vector4  b 
)
static

Calculate the component-wise minimum of two vectors

Parameters
aFirst operand
bSecond operand
Returns
The component-wise minimum
static void OpenTK.Vector4.Min ( ref Vector4  a,
ref Vector4  b,
out Vector4  result 
)
static

Calculate the component-wise minimum of two vectors

Parameters
aFirst operand
bSecond operand
resultThe component-wise minimum
void OpenTK.Vector4.Mult ( float  f)

Multiply this instance by a scalar.

Parameters
fScalar operand.
static Vector4 OpenTK.Vector4.Mult ( Vector4  a,
float  f 
)
static

Multiply a vector and a scalar

Parameters
aVector operand
fScalar operand
Returns
Result of the multiplication
static void OpenTK.Vector4.Mult ( ref Vector4  a,
float  f,
out Vector4  result 
)
static

Multiply a vector and a scalar

Parameters
aVector operand
fScalar operand
resultResult of the multiplication
static Vector4 OpenTK.Vector4.Multiply ( Vector4  vector,
float  scale 
)
static

Multiplies a vector by a scalar.

Parameters
vectorLeft operand.
scaleRight operand.
Returns
Result of the operation.
static void OpenTK.Vector4.Multiply ( ref Vector4  vector,
float  scale,
out Vector4  result 
)
static

Multiplies a vector by a scalar.

Parameters
vectorLeft operand.
scaleRight operand.
resultResult of the operation.
static Vector4 OpenTK.Vector4.Multiply ( Vector4  vector,
Vector4  scale 
)
static

Multiplies a vector by the components a vector (scale).

Parameters
vectorLeft operand.
scaleRight operand.
Returns
Result of the operation.
static void OpenTK.Vector4.Multiply ( ref Vector4  vector,
ref Vector4  scale,
out Vector4  result 
)
static

Multiplies a vector by the components of a vector (scale).

Parameters
vectorLeft operand.
scaleRight operand.
resultResult of the operation.
void OpenTK.Vector4.Normalize ( )

Scales the Vector4 to unit length.

static Vector4 OpenTK.Vector4.Normalize ( Vector4  vec)
static

Scale a vector to unit length

Parameters
vecThe input vector
Returns
The normalized vector
static void OpenTK.Vector4.Normalize ( ref Vector4  vec,
out Vector4  result 
)
static

Scale a vector to unit length

Parameters
vecThe input vector
resultThe normalized vector
Vector4 OpenTK.Vector4.Normalized ( )

Returns a copy of the Vector4 scaled to unit length.

void OpenTK.Vector4.NormalizeFast ( )

Scales the Vector4 to approximately unit length.

static Vector4 OpenTK.Vector4.NormalizeFast ( Vector4  vec)
static

Scale a vector to approximately unit length

Parameters
vecThe input vector
Returns
The normalized vector
static void OpenTK.Vector4.NormalizeFast ( ref Vector4  vec,
out Vector4  result 
)
static

Scale a vector to approximately unit length

Parameters
vecThe input vector
resultThe normalized vector
unsafe static OpenTK.Vector4.operator float * ( Vector4  v)
explicitstatic

Returns a pointer to the first element of the specified instance.

Parameters
vThe instance.
Returns
A pointer to the first element of v.
static OpenTK.Vector4.operator IntPtr ( Vector4  v)
explicitstatic

Returns a pointer to the first element of the specified instance.

Parameters
vThe instance.
Returns
A pointer to the first element of v.
static bool OpenTK.Vector4.operator!= ( Vector4  left,
Vector4  right 
)
static

Compares two instances for inequality.

Parameters
leftThe first instance.
rightThe second instance.
Returns
True, if left does not equa lright; false otherwise.
static Vector4 OpenTK.Vector4.operator* ( Vector4  vec,
float  scale 
)
static

Multiplies an instance by a scalar.

Parameters
vecThe instance.
scaleThe scalar.
Returns
The result of the calculation.
static Vector4 OpenTK.Vector4.operator* ( float  scale,
Vector4  vec 
)
static

Multiplies an instance by a scalar.

Parameters
scaleThe scalar.
vecThe instance.
Returns
The result of the calculation.
static Vector4 OpenTK.Vector4.operator+ ( Vector4  left,
Vector4  right 
)
static

Adds two instances.

Parameters
leftThe first instance.
rightThe second instance.
Returns
The result of the calculation.
static Vector4 OpenTK.Vector4.operator- ( Vector4  left,
Vector4  right 
)
static

Subtracts two instances.

Parameters
leftThe first instance.
rightThe second instance.
Returns
The result of the calculation.
static Vector4 OpenTK.Vector4.operator- ( Vector4  vec)
static

Negates an instance.

Parameters
vecThe instance.
Returns
The result of the calculation.
static Vector4 OpenTK.Vector4.operator/ ( Vector4  vec,
float  scale 
)
static

Divides an instance by a scalar.

Parameters
vecThe instance.
scaleThe scalar.
Returns
The result of the calculation.
static bool OpenTK.Vector4.operator== ( Vector4  left,
Vector4  right 
)
static

Compares two instances for equality.

Parameters
leftThe first instance.
rightThe second instance.
Returns
True, if left equals right; false otherwise.
void OpenTK.Vector4.Scale ( float  sx,
float  sy,
float  sz,
float  sw 
)

Scales the current Vector4 by the given amounts.

Parameters
sxThe scale of the X component.
syThe scale of the Y component.
szThe scale of the Z component.
swThe scale of the Z component.
void OpenTK.Vector4.Scale ( Vector4  scale)

Scales this instance by the given parameter.

Parameters
scaleThe scaling of the individual components.
void OpenTK.Vector4.Scale ( ref Vector4  scale)

Scales this instance by the given parameter.

Parameters
scaleThe scaling of the individual components.
void OpenTK.Vector4.Sub ( Vector4  right)

Subtract the Vector passed as parameter from this instance.

Parameters
rightRight operand. This parameter is only read from.
void OpenTK.Vector4.Sub ( ref Vector4  right)

Subtract the Vector passed as parameter from this instance.

Parameters
rightRight operand. This parameter is only read from.
static Vector4 OpenTK.Vector4.Sub ( Vector4  a,
Vector4  b 
)
static

Subtract one Vector from another

Parameters
aFirst operand
bSecond operand
Returns
Result of subtraction
static void OpenTK.Vector4.Sub ( ref Vector4  a,
ref Vector4  b,
out Vector4  result 
)
static

Subtract one Vector from another

Parameters
aFirst operand
bSecond operand
resultResult of subtraction
static Vector4 OpenTK.Vector4.Subtract ( Vector4  a,
Vector4  b 
)
static

Subtract one Vector from another

Parameters
aFirst operand
bSecond operand
Returns
Result of subtraction
static void OpenTK.Vector4.Subtract ( ref Vector4  a,
ref Vector4  b,
out Vector4  result 
)
static

Subtract one Vector from another

Parameters
aFirst operand
bSecond operand
resultResult of subtraction
override string OpenTK.Vector4.ToString ( )

Returns a System.String that represents the current Vector4.

Returns
static Vector4 OpenTK.Vector4.Transform ( Vector4  vec,
Matrix4  mat 
)
static

Transform a Vector by the given Matrix

Parameters
vecThe vector to transform
matThe desired transformation
Returns
The transformed vector
static void OpenTK.Vector4.Transform ( ref Vector4  vec,
ref Matrix4  mat,
out Vector4  result 
)
static

Transform a Vector by the given Matrix

Parameters
vecThe vector to transform
matThe desired transformation
resultThe transformed vector
static Vector4 OpenTK.Vector4.Transform ( Vector4  vec,
Quaternion  quat 
)
static

Transforms a vector by a quaternion rotation.

Parameters
vecThe vector to transform.
quatThe quaternion to rotate the vector by.
Returns
The result of the operation.
static void OpenTK.Vector4.Transform ( ref Vector4  vec,
ref Quaternion  quat,
out Vector4  result 
)
static

Transforms a vector by a quaternion rotation.

Parameters
vecThe vector to transform.
quatThe quaternion to rotate the vector by.
resultThe result of the operation.

Member Data Documentation

readonly Vector4 OpenTK.Vector4.One = new Vector4(1, 1, 1, 1)
static

Defines an instance with all components set to 1.

readonly int OpenTK.Vector4.SizeInBytes = Marshal.SizeOf(new Vector4())
static

Defines the size of the Vector4 struct in bytes.

readonly Vector4 OpenTK.Vector4.UnitW = new Vector4(0, 0, 0, 1)
static

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

readonly Vector4 OpenTK.Vector4.UnitX = new Vector4(1, 0, 0, 0)
static

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

readonly Vector4 OpenTK.Vector4.UnitY = new Vector4(0, 1, 0, 0)
static

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

readonly Vector4 OpenTK.Vector4.UnitZ = new Vector4(0, 0, 1, 0)
static

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

float OpenTK.Vector4.W

The W component of the Vector4.

float OpenTK.Vector4.X

The X component of the Vector4.

float OpenTK.Vector4.Y

The Y component of the Vector4.

float OpenTK.Vector4.Z

The Z component of the Vector4.

readonly Vector4 OpenTK.Vector4.Zero = new Vector4(0, 0, 0, 0)
static

Defines a zero-length Vector4.

Property Documentation

float OpenTK.Vector4.Length
get

Gets the length (magnitude) of the vector.

LengthFast

See Also
LengthSquared
float OpenTK.Vector4.LengthFast
get

Gets an approximation of the vector length (magnitude).

This property uses an approximation of the square root function to calculate vector magnitude, with an upper error bound of 0.001.

Length

See Also
LengthSquared
float OpenTK.Vector4.LengthSquared
get

Gets the square of the vector length (magnitude).

This property avoids the costly square root operation required by the Length property. This makes it more suitable for comparisons.

Length

See Also
LengthFast
float OpenTK.Vector4.this[int index]
getset

Gets or sets the value at the index of the Vector.

Vector2 OpenTK.Vector4.Wx
getset

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

Vector3 OpenTK.Vector4.Wxy
getset

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

Vector4 OpenTK.Vector4.Wxyz
getset

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

Vector3 OpenTK.Vector4.Wxz
getset

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

Vector4 OpenTK.Vector4.Wxzy
getset

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

Vector2 OpenTK.Vector4.Wy
getset

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

Vector3 OpenTK.Vector4.Wyx
getset

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

Vector4 OpenTK.Vector4.Wyxz
getset

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

Vector3 OpenTK.Vector4.Wyz
getset

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

Vector4 OpenTK.Vector4.Wyzx
getset

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

Vector2 OpenTK.Vector4.Wz
getset

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

Vector3 OpenTK.Vector4.Wzx
getset

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

Vector4 OpenTK.Vector4.Wzxy
getset

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

Vector3 OpenTK.Vector4.Wzy
getset

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

Vector4 OpenTK.Vector4.Wzyw
getset

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

Vector4 OpenTK.Vector4.Wzyx
getset

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

Vector2 OpenTK.Vector4.Xw
getset

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

Vector3 OpenTK.Vector4.Xwy
getset

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

Vector4 OpenTK.Vector4.Xwyz
getset

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

Vector3 OpenTK.Vector4.Xwz
getset

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

Vector4 OpenTK.Vector4.Xwzy
getset

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

Vector2 OpenTK.Vector4.Xy
getset

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

Vector3 OpenTK.Vector4.Xyw
getset

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

Vector4 OpenTK.Vector4.Xywz
getset

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

Vector3 OpenTK.Vector4.Xyz
getset

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

Vector2 OpenTK.Vector4.Xz
getset

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

Vector3 OpenTK.Vector4.Xzw
getset

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

Vector4 OpenTK.Vector4.Xzwy
getset

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

Vector3 OpenTK.Vector4.Xzy
getset

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

Vector4 OpenTK.Vector4.Xzyw
getset

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

Vector2 OpenTK.Vector4.Yw
getset

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

Vector3 OpenTK.Vector4.Ywx
getset

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

Vector4 OpenTK.Vector4.Ywxz
getset

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

Vector3 OpenTK.Vector4.Ywz
getset

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

Vector4 OpenTK.Vector4.Ywzx
getset

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

Vector2 OpenTK.Vector4.Yx
getset

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

Vector3 OpenTK.Vector4.Yxw
getset

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

Vector4 OpenTK.Vector4.Yxwz
getset

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

Vector3 OpenTK.Vector4.Yxz
getset

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

Vector4 OpenTK.Vector4.Yxzw
getset

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

Vector4 OpenTK.Vector4.Yywz
getset

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

Vector4 OpenTK.Vector4.Yyzw
getset

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

Vector2 OpenTK.Vector4.Yz
getset

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

Vector3 OpenTK.Vector4.Yzw
getset

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

Vector4 OpenTK.Vector4.Yzwx
getset

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

Vector3 OpenTK.Vector4.Yzx
getset

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

Vector4 OpenTK.Vector4.Yzxw
getset

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

Vector2 OpenTK.Vector4.Zw
getset

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

Vector3 OpenTK.Vector4.Zwx
getset

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

Vector4 OpenTK.Vector4.Zwxy
getset

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

Vector3 OpenTK.Vector4.Zwy
getset

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

Vector4 OpenTK.Vector4.Zwyx
getset

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

Vector4 OpenTK.Vector4.Zwzy
getset

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

Vector2 OpenTK.Vector4.Zx
getset

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

Vector3 OpenTK.Vector4.Zxw
getset

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

Vector4 OpenTK.Vector4.Zxwy
getset

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

Vector3 OpenTK.Vector4.Zxy
getset

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

Vector4 OpenTK.Vector4.Zxyw
getset

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

Vector2 OpenTK.Vector4.Zy
getset

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

Vector3 OpenTK.Vector4.Zyw
getset

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

Vector4 OpenTK.Vector4.Zywx
getset

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

Vector3 OpenTK.Vector4.Zyx
getset

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

Vector4 OpenTK.Vector4.Zyxw
getset

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