VR-Link C# API Documentation
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Properties | Static Private Attributes
makVrl.Vector4 Struct Reference

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

+ Inheritance diagram for makVrl.Vector4:
+ Collaboration diagram for makVrl.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 (Vector3f v)
 Constructs a new Vector4 from the given Vector3. More...
 
 Vector4 (Vector3f 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...
 

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 makVrl.Vector2 with the X and Y components of this instance. More...
 
Vector2 Xz [get, set]
 Gets or sets an makVrl.Vector2 with the X and Z components of this instance. More...
 
Vector2 Xw [get, set]
 Gets or sets an makVrl.Vector2 with the X and W components of this instance. More...
 
Vector2 Yx [get, set]
 Gets or sets an makVrl.Vector2 with the Y and X components of this instance. More...
 
Vector2 Yz [get, set]
 Gets or sets an makVrl.Vector2 with the Y and Z components of this instance. More...
 
Vector2 Yw [get, set]
 Gets or sets an makVrl.Vector2 with the Y and W components of this instance. More...
 
Vector2 Zx [get, set]
 Gets or sets an makVrl.Vector2 with the Z and X components of this instance. More...
 
Vector2 Zy [get, set]
 Gets or sets an makVrl.Vector2 with the Z and Y components of this instance. More...
 
Vector2 Zw [get, set]
 Gets an makVrl.Vector2 with the Z and W components of this instance. More...
 
Vector2 Wx [get, set]
 Gets or sets an makVrl.Vector2 with the W and X components of this instance. More...
 
Vector2 Wy [get, set]
 Gets or sets an makVrl.Vector2 with the W and Y components of this instance. More...
 
Vector2 Wz [get, set]
 Gets or sets an makVrl.Vector2 with the W and Z components of this instance. More...
 
Vector3f Xyz [get, set]
 Gets or sets an makVrl.Vector3 with the X, Y, and Z components of this instance. More...
 
Vector3f Xyw [get, set]
 Gets or sets an makVrl.Vector3 with the X, Y, and Z components of this instance. More...
 
Vector3f Xzy [get, set]
 Gets or sets an makVrl.Vector3 with the X, Z, and Y components of this instance. More...
 
Vector3f Xzw [get, set]
 Gets or sets an makVrl.Vector3 with the X, Z, and W components of this instance. More...
 
Vector3f Xwy [get, set]
 Gets or sets an makVrl.Vector3 with the X, W, and Y components of this instance. More...
 
Vector3f Xwz [get, set]
 Gets or sets an makVrl.Vector3 with the X, W, and Z components of this instance. More...
 
Vector3f Yxz [get, set]
 Gets or sets an makVrl.Vector3 with the Y, X, and Z components of this instance. More...
 
Vector3f Yxw [get, set]
 Gets or sets an makVrl.Vector3 with the Y, X, and W components of this instance. More...
 
Vector3f Yzx [get, set]
 Gets or sets an makVrl.Vector3 with the Y, Z, and X components of this instance. More...
 
Vector3f Yzw [get, set]
 Gets or sets an makVrl.Vector3 with the Y, Z, and W components of this instance. More...
 
Vector3f Ywx [get, set]
 Gets or sets an makVrl.Vector3 with the Y, W, and X components of this instance. More...
 
Vector3f Ywz [get, set]
 Gets an makVrl.Vector3 with the Y, W, and Z components of this instance. More...
 
Vector3f Zxy [get, set]
 Gets or sets an makVrl.Vector3 with the Z, X, and Y components of this instance. More...
 
Vector3f Zxw [get, set]
 Gets or sets an makVrl.Vector3 with the Z, X, and W components of this instance. More...
 
Vector3f Zyx [get, set]
 Gets or sets an makVrl.Vector3 with the Z, Y, and X components of this instance. More...
 
Vector3f Zyw [get, set]
 Gets or sets an makVrl.Vector3 with the Z, Y, and W components of this instance. More...
 
Vector3f Zwx [get, set]
 Gets or sets an makVrl.Vector3 with the Z, W, and X components of this instance. More...
 
Vector3f Zwy [get, set]
 Gets or sets an makVrl.Vector3 with the Z, W, and Y components of this instance. More...
 
Vector3f Wxy [get, set]
 Gets or sets an makVrl.Vector3 with the W, X, and Y components of this instance. More...
 
Vector3f Wxz [get, set]
 Gets or sets an makVrl.Vector3 with the W, X, and Z components of this instance. More...
 
Vector3f Wyx [get, set]
 Gets or sets an makVrl.Vector3 with the W, Y, and X components of this instance. More...
 
Vector3f Wyz [get, set]
 Gets or sets an makVrl.Vector3 with the W, Y, and Z components of this instance. More...
 
Vector3f Wzx [get, set]
 Gets or sets an makVrl.Vector3 with the W, Z, and X components of this instance. More...
 
Vector3f Wzy [get, set]
 Gets or sets an makVrl.Vector3 with the W, Z, and Y components of this instance. More...
 
Vector4 Xywz [get, set]
 Gets or sets an makVrl.Vector4 with the X, Y, W, and Z components of this instance. More...
 
Vector4 Xzyw [get, set]
 Gets or sets an makVrl.Vector4 with the X, Z, Y, and W components of this instance. More...
 
Vector4 Xzwy [get, set]
 Gets or sets an makVrl.Vector4 with the X, Z, W, and Y components of this instance. More...
 
Vector4 Xwyz [get, set]
 Gets or sets an makVrl.Vector4 with the X, W, Y, and Z components of this instance. More...
 
Vector4 Xwzy [get, set]
 Gets or sets an makVrl.Vector4 with the X, W, Z, and Y components of this instance. More...
 
Vector4 Yxzw [get, set]
 Gets or sets an makVrl.Vector4 with the Y, X, Z, and W components of this instance. More...
 
Vector4 Yxwz [get, set]
 Gets or sets an makVrl.Vector4 with the Y, X, W, and Z components of this instance. More...
 
Vector4 Yyzw [get, set]
 Gets an makVrl.Vector4 with the Y, Y, Z, and W components of this instance. More...
 
Vector4 Yywz [get, set]
 Gets an makVrl.Vector4 with the Y, Y, W, and Z components of this instance. More...
 
Vector4 Yzxw [get, set]
 Gets or sets an makVrl.Vector4 with the Y, Z, X, and W components of this instance. More...
 
Vector4 Yzwx [get, set]
 Gets or sets an makVrl.Vector4 with the Y, Z, W, and X components of this instance. More...
 
Vector4 Ywxz [get, set]
 Gets or sets an makVrl.Vector4 with the Y, W, X, and Z components of this instance. More...
 
Vector4 Ywzx [get, set]
 Gets or sets an makVrl.Vector4 with the Y, W, Z, and X components of this instance. More...
 
Vector4 Zxyw [get, set]
 Gets or sets an makVrl.Vector4 with the Z, X, Y, and Z components of this instance. More...
 
Vector4 Zxwy [get, set]
 Gets or sets an makVrl.Vector4 with the Z, X, W, and Y components of this instance. More...
 
Vector4 Zyxw [get, set]
 Gets or sets an makVrl.Vector4 with the Z, Y, X, and W components of this instance. More...
 
Vector4 Zywx [get, set]
 Gets or sets an makVrl.Vector4 with the Z, Y, W, and X components of this instance. More...
 
Vector4 Zwxy [get, set]
 Gets or sets an makVrl.Vector4 with the Z, W, X, and Y components of this instance. More...
 
Vector4 Zwyx [get, set]
 Gets or sets an makVrl.Vector4 with the Z, W, Y, and X components of this instance. More...
 
Vector4 Zwzy [get, set]
 Gets an makVrl.Vector4 with the Z, W, Z, and Y components of this instance. More...
 
Vector4 Wxyz [get, set]
 Gets or sets an makVrl.Vector4 with the W, X, Y, and Z components of this instance. More...
 
Vector4 Wxzy [get, set]
 Gets or sets an makVrl.Vector4 with the W, X, Z, and Y components of this instance. More...
 
Vector4 Wyxz [get, set]
 Gets or sets an makVrl.Vector4 with the W, Y, X, and Z components of this instance. More...
 
Vector4 Wyzx [get, set]
 Gets or sets an makVrl.Vector4 with the W, Y, Z, and X components of this instance. More...
 
Vector4 Wzxy [get, set]
 Gets or sets an makVrl.Vector4 with the W, Z, X, and Y components of this instance. More...
 
Vector4 Wzyx [get, set]
 Gets or sets an makVrl.Vector4 with the W, Z, Y, and X components of this instance. More...
 
Vector4 Wzyw [get, set]
 Gets an makVrl.Vector4 with the W, Z, Y, and W components of this instance. More...
 

Static Private Attributes

static string listSeparator = System.Globalization.CultureInfo.CurrentCulture.TextInfo.ListSeparator
 

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

makVrl.Vector4.Vector4 ( float  value)
inline

Constructs a new instance.

Parameters
valueThe value that will initialize this instance.

References makVrl.Vector4.W, makVrl.Vector4.X, makVrl.Vector4.Y, and makVrl.Vector4.Z.

Referenced by makVrl.Vector4.Add(), makVrl.Vector4.Divide(), makVrl.Vector4.Equals(), makVrl.Vector4.Multiply(), makVrl.Vector4.Subtract(), and makVrl.Vector4.Transform().

makVrl.Vector4.Vector4 ( float  x,
float  y,
float  z,
float  w 
)
inline

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.

References makVrl.Vector4.W, makVrl.Vector4.X, makVrl.Vector4.Y, and makVrl.Vector4.Z.

makVrl.Vector4.Vector4 ( Vector2  v)
inline

Constructs a new Vector4 from the given Vector2.

Parameters
vThe Vector2 to copy components from.

References makVrl.Vector4.W, makVrl.Vector4.X, makVrl.Vector4.Y, and makVrl.Vector4.Z.

makVrl.Vector4.Vector4 ( Vector3f  v)
inline

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(Vector3f, float)

References makVrl.Vector4.W, makVrl.Vector4.X, makVrl.Vector4.Y, and makVrl.Vector4.Z.

makVrl.Vector4.Vector4 ( Vector3f  v,
float  w 
)
inline

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.

References makVrl.Vector4.W, makVrl.Vector4.X, makVrl.Vector4.Y, and makVrl.Vector4.Z.

makVrl.Vector4.Vector4 ( Vector4  v)
inline

Constructs a new Vector4 from the given Vector4.

Parameters
vThe Vector4 to copy components from.

References makVrl.Vector4.W, makVrl.Vector4.X, makVrl.Vector4.Y, and makVrl.Vector4.Z.

Member Function Documentation

void makVrl.Vector4.Add ( Vector4  right)
inline

Add the Vector passed as parameter to this instance.

Parameters
rightRight operand. This parameter is only read from.

Referenced by makVrl.Vector4.Add(), and makVrl.Vector4.BaryCentric().

void makVrl.Vector4.Add ( ref Vector4  right)
inline

Add the Vector passed as parameter to this instance.

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

Adds two vectors.

Parameters
aLeft operand.
bRight operand.
Returns
Result of operation.

References makVrl.Vector4.Add().

static void makVrl.Vector4.Add ( ref Vector4  a,
ref Vector4  b,
out Vector4  result 
)
inlinestatic

Adds two vectors.

Parameters
aLeft operand.
bRight operand.
resultResult of operation.

References makVrl.Vector4.Vector4().

static Vector4 makVrl.Vector4.BaryCentric ( Vector4  a,
Vector4  b,
Vector4  c,
float  u,
float  v 
)
inlinestatic

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 makVrl.Vector4.BaryCentric ( ref Vector4  a,
ref Vector4  b,
ref Vector4  c,
float  u,
float  v,
out Vector4  result 
)
inlinestatic

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

References makVrl.Vector4.Add(), makVrl.Vector4.Multiply(), and makVrl.Vector4.Subtract().

static Vector4 makVrl.Vector4.Clamp ( Vector4  vec,
Vector4  min,
Vector4  max 
)
inlinestatic

Clamp a vector to the given minimum and maximum vectors

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

Clamp a vector to the given minimum and maximum vectors

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

Divide this instance by a scalar.

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

Divide a vector by a scalar

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

Divide a vector by a scalar

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

Divides a vector by a scalar.

Parameters
vectorLeft operand.
scaleRight operand.
Returns
Result of the operation.

Referenced by makVrl.Vector4.Divide().

static void makVrl.Vector4.Divide ( ref Vector4  vector,
float  scale,
out Vector4  result 
)
inlinestatic

Divides a vector by a scalar.

Parameters
vectorLeft operand.
scaleRight operand.
resultResult of the operation.

References makVrl.Vector4.Multiply().

static Vector4 makVrl.Vector4.Divide ( Vector4  vector,
Vector4  scale 
)
inlinestatic

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

Parameters
vectorLeft operand.
scaleRight operand.
Returns
Result of the operation.

References makVrl.Vector4.Divide().

static void makVrl.Vector4.Divide ( ref Vector4  vector,
ref Vector4  scale,
out Vector4  result 
)
inlinestatic

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

Parameters
vectorLeft operand.
scaleRight operand.
resultResult of the operation.

References makVrl.Vector4.Vector4().

static float makVrl.Vector4.Dot ( Vector4  left,
Vector4  right 
)
inlinestatic

Calculate the dot product of two vectors

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

Calculate the dot product of two vectors

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

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.

References makVrl.Vector4.Vector4().

bool makVrl.Vector4.Equals ( Vector4  other)
inline

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.

References makVrl.Vector4.W, makVrl.Vector4.X, makVrl.Vector4.Y, and makVrl.Vector4.Z.

override int makVrl.Vector4.GetHashCode ( )
inline

Returns the hashcode for this instance.

Returns
A System.Int32 containing the unique hashcode for this instance.

References makVrl.Vector4.W, and makVrl.Vector4.Y.

Referenced by makVrl.Matrix4.GetHashCode().

static Vector4 makVrl.Vector4.Lerp ( Vector4  a,
Vector4  b,
float  blend 
)
inlinestatic

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

References makVrl.Vector4.W, makVrl.Vector4.X, makVrl.Vector4.Y, and makVrl.Vector4.Z.

static void makVrl.Vector4.Lerp ( ref Vector4  a,
ref Vector4  b,
float  blend,
out Vector4  result 
)
inlinestatic

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 makVrl.Vector4.Max ( Vector4  a,
Vector4  b 
)
inlinestatic

Calculate the component-wise maximum of two vectors

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

Calculate the component-wise maximum of two vectors

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

Calculate the component-wise minimum of two vectors

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

Calculate the component-wise minimum of two vectors

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

Multiply this instance by a scalar.

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

Multiply a vector and a scalar

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

Multiply a vector and a scalar

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

Multiplies a vector by a scalar.

Parameters
vectorLeft operand.
scaleRight operand.
Returns
Result of the operation.

Referenced by makVrl.Vector4.BaryCentric(), makVrl.Vector4.Divide(), and makVrl.Vector4.Multiply().

static void makVrl.Vector4.Multiply ( ref Vector4  vector,
float  scale,
out Vector4  result 
)
inlinestatic

Multiplies a vector by a scalar.

Parameters
vectorLeft operand.
scaleRight operand.
resultResult of the operation.

References makVrl.Vector4.Vector4().

static Vector4 makVrl.Vector4.Multiply ( Vector4  vector,
Vector4  scale 
)
inlinestatic

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

Parameters
vectorLeft operand.
scaleRight operand.
Returns
Result of the operation.

References makVrl.Vector4.Multiply().

static void makVrl.Vector4.Multiply ( ref Vector4  vector,
ref Vector4  scale,
out Vector4  result 
)
inlinestatic

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

Parameters
vectorLeft operand.
scaleRight operand.
resultResult of the operation.

References makVrl.Vector4.Vector4().

void makVrl.Vector4.Normalize ( )
inline

Scales the Vector4 to unit length.

References makVrl.Vector4.W, makVrl.Vector4.X, makVrl.Vector4.Y, and makVrl.Vector4.Z.

static Vector4 makVrl.Vector4.Normalize ( Vector4  vec)
inlinestatic

Scale a vector to unit length

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

Scale a vector to unit length

Parameters
vecThe input vector
resultThe normalized vector
Vector4 makVrl.Vector4.Normalized ( )
inline

Returns a copy of the Vector4 scaled to unit length.

void makVrl.Vector4.NormalizeFast ( )
inline

Scales the Vector4 to approximately unit length.

References makVrl.Vector4.W, makVrl.Vector4.X, makVrl.Vector4.Y, and makVrl.Vector4.Z.

static Vector4 makVrl.Vector4.NormalizeFast ( Vector4  vec)
inlinestatic

Scale a vector to approximately unit length

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

Scale a vector to approximately unit length

Parameters
vecThe input vector
resultThe normalized vector
static bool makVrl.Vector4.operator!= ( Vector4  left,
Vector4  right 
)
inlinestatic

Compares two instances for inequality.

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

Multiplies an instance by a scalar.

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

Multiplies an instance by a scalar.

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

Adds two instances.

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

Subtracts two instances.

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

Negates an instance.

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

Divides an instance by a scalar.

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

Compares two instances for equality.

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

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.

References makVrl.Vector4.W, makVrl.Vector4.X, makVrl.Vector4.Y, and makVrl.Vector4.Z.

void makVrl.Vector4.Scale ( Vector4  scale)
inline

Scales this instance by the given parameter.

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

Scales this instance by the given parameter.

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

Subtract the Vector passed as parameter from this instance.

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

Subtract the Vector passed as parameter from this instance.

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

Subtract one Vector from another

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

Subtract one Vector from another

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

Subtract one Vector from another

Parameters
aFirst operand
bSecond operand
Returns
Result of subtraction

Referenced by makVrl.Vector4.BaryCentric().

static void makVrl.Vector4.Subtract ( ref Vector4  a,
ref Vector4  b,
out Vector4  result 
)
inlinestatic

Subtract one Vector from another

Parameters
aFirst operand
bSecond operand
resultResult of subtraction

References makVrl.Vector4.Vector4().

override string makVrl.Vector4.ToString ( )
inline

Returns a System.String that represents the current Vector4.

Returns

References makVrl.Vector4.listSeparator, makVrl.Vector4.W, makVrl.Vector4.X, makVrl.Vector4.Y, and makVrl.Vector4.Z.

static Vector4 makVrl.Vector4.Transform ( Vector4  vec,
Matrix4  mat 
)
inlinestatic

Transform a Vector by the given Matrix

Parameters
vecThe vector to transform
matThe desired transformation
Returns
The transformed vector

Referenced by makVrl.Vector4.Transform().

static void makVrl.Vector4.Transform ( ref Vector4  vec,
ref Matrix4  mat,
out Vector4  result 
)
inlinestatic

Transform a Vector by the given Matrix

Parameters
vecThe vector to transform
matThe desired transformation
resultThe transformed vector

References makVrl.Vector4.Vector4().

static Vector4 makVrl.Vector4.Transform ( Vector4  vec,
Quaternion  quat 
)
inlinestatic

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.

References makVrl.Vector4.Transform().

static void makVrl.Vector4.Transform ( ref Vector4  vec,
ref Quaternion  quat,
out Vector4  result 
)
inlinestatic

Transforms a vector by a quaternion rotation.

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

References makVrl.Vector4.Vector4().

Member Data Documentation

string makVrl.Vector4.listSeparator = System.Globalization.CultureInfo.CurrentCulture.TextInfo.ListSeparator
staticprivate

Referenced by makVrl.Vector4.ToString().

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

Defines an instance with all components set to 1.

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

Defines the size of the Vector4 struct in bytes.

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

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

Referenced by makVrl.Matrix4.CreateFromAxisAngle(), and makVrl.Matrix4.Scale().

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

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

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

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

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

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

float makVrl.Vector4.W
float makVrl.Vector4.X
float makVrl.Vector4.Y
float makVrl.Vector4.Z
readonly Vector4 makVrl.Vector4.Zero = new Vector4(0, 0, 0, 0)
static

Defines a zero-length Vector4.

Referenced by makVrl.Matrix4.ClearProjection().

Property Documentation

float makVrl.Vector4.Length
get

Gets the length (magnitude) of the vector.

LengthFast

See Also
LengthSquared
float makVrl.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 makVrl.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 makVrl.Vector4.this[int index]
getset

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

Vector2 makVrl.Vector4.Wx
getset

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

Vector3f makVrl.Vector4.Wxy
getset

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

Vector4 makVrl.Vector4.Wxyz
getset

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

Vector3f makVrl.Vector4.Wxz
getset

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

Vector4 makVrl.Vector4.Wxzy
getset

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

Vector2 makVrl.Vector4.Wy
getset

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

Vector3f makVrl.Vector4.Wyx
getset

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

Vector4 makVrl.Vector4.Wyxz
getset

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

Vector3f makVrl.Vector4.Wyz
getset

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

Vector4 makVrl.Vector4.Wyzx
getset

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

Vector2 makVrl.Vector4.Wz
getset

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

Vector3f makVrl.Vector4.Wzx
getset

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

Vector4 makVrl.Vector4.Wzxy
getset

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

Vector3f makVrl.Vector4.Wzy
getset

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

Vector4 makVrl.Vector4.Wzyw
getset

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

Vector4 makVrl.Vector4.Wzyx
getset

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

Vector2 makVrl.Vector4.Xw
getset

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

Vector3f makVrl.Vector4.Xwy
getset

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

Vector4 makVrl.Vector4.Xwyz
getset

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

Vector3f makVrl.Vector4.Xwz
getset

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

Vector4 makVrl.Vector4.Xwzy
getset

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

Vector2 makVrl.Vector4.Xy
getset

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

Vector3f makVrl.Vector4.Xyw
getset

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

Vector4 makVrl.Vector4.Xywz
getset

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

Vector3f makVrl.Vector4.Xyz
getset

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

Referenced by makVrl.Matrix4.ClearRotation(), and makVrl.Matrix4.ExtractScale().

Vector2 makVrl.Vector4.Xz
getset

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

Vector3f makVrl.Vector4.Xzw
getset

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

Vector4 makVrl.Vector4.Xzwy
getset

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

Vector3f makVrl.Vector4.Xzy
getset

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

Vector4 makVrl.Vector4.Xzyw
getset

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

Vector2 makVrl.Vector4.Yw
getset

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

Vector3f makVrl.Vector4.Ywx
getset

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

Vector4 makVrl.Vector4.Ywxz
getset

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

Vector3f makVrl.Vector4.Ywz
getset

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

Vector4 makVrl.Vector4.Ywzx
getset

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

Vector2 makVrl.Vector4.Yx
getset

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

Vector3f makVrl.Vector4.Yxw
getset

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

Vector4 makVrl.Vector4.Yxwz
getset

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

Vector3f makVrl.Vector4.Yxz
getset

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

Vector4 makVrl.Vector4.Yxzw
getset

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

Vector4 makVrl.Vector4.Yywz
getset

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

Vector4 makVrl.Vector4.Yyzw
getset

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

Vector2 makVrl.Vector4.Yz
getset

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

Vector3f makVrl.Vector4.Yzw
getset

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

Vector4 makVrl.Vector4.Yzwx
getset

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

Vector3f makVrl.Vector4.Yzx
getset

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

Vector4 makVrl.Vector4.Yzxw
getset

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

Vector2 makVrl.Vector4.Zw
getset

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

Vector3f makVrl.Vector4.Zwx
getset

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

Vector4 makVrl.Vector4.Zwxy
getset

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

Vector3f makVrl.Vector4.Zwy
getset

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

Vector4 makVrl.Vector4.Zwyx
getset

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

Vector4 makVrl.Vector4.Zwzy
getset

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

Vector2 makVrl.Vector4.Zx
getset

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

Vector3f makVrl.Vector4.Zxw
getset

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

Vector4 makVrl.Vector4.Zxwy
getset

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

Vector3f makVrl.Vector4.Zxy
getset

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

Vector4 makVrl.Vector4.Zxyw
getset

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

Vector2 makVrl.Vector4.Zy
getset

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

Vector3f makVrl.Vector4.Zyw
getset

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

Vector4 makVrl.Vector4.Zywx
getset

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

Vector3f makVrl.Vector4.Zyx
getset

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

Vector4 makVrl.Vector4.Zyxw
getset

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


The documentation for this struct was generated from the following file:

Document ID: Generated on Mon Apr 25 03:39:01 EDT 2022 from SVN revision 242502
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)