Shift
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Pages
Shift.Vector4 Struct Reference

Describes a 4D-vector. More...

Inheritance diagram for Shift.Vector4:

Public Member Functions

 Vector4 (float x, float y, float z, float w)
 Constructs a 3d vector with X, Y, Z and W from four values. More...
 
 Vector4 (Vector2 value, float z, float w)
 Constructs a 3d vector with X and Z from Vector2 and Z and W from the scalars. More...
 
 Vector4 (Vector3 value, float w)
 Constructs a 3d vector with X, Y, Z from Vector3 and W from a scalar. More...
 
 Vector4 (float value)
 Constructs a 4d vector with X, Y, Z and W set to the same value. More...
 
override bool Equals (object obj)
 Compares whether current instance is equal to specified Object. More...
 
bool Equals (Vector4 other)
 Compares whether current instance is equal to specified Vector4. More...
 
override int GetHashCode ()
 Gets the hash code of this Vector4. More...
 
float Length ()
 Returns the length of this Vector4. More...
 
float LengthSquared ()
 Returns the squared length of this Vector4. More...
 
void Normalize ()
 Turns this Vector4 to a unit vector with the same direction. More...
 
override string ToString ()
 Returns a String representation of this Vector4 in the format: {X:[X] Y:[Y] Z:[Z] W:[W]} More...
 

Static Public Member Functions

static Vector4 Add (Vector4 value1, Vector4 value2)
 Performs vector addition on value1 and value2 . More...
 
static void Add (ref Vector4 value1, ref Vector4 value2, out Vector4 result)
 Performs vector addition on value1 and value2 , storing the result of the addition in result . More...
 
static Vector4 Barycentric (Vector4 value1, Vector4 value2, Vector4 value3, float amount1, float amount2)
 Creates a new Vector4 that contains the cartesian coordinates of a vector specified in barycentric coordinates and relative to 4d-triangle. More...
 
static void Barycentric (ref Vector4 value1, ref Vector4 value2, ref Vector4 value3, float amount1, float amount2, out Vector4 result)
 Creates a new Vector4 that contains the cartesian coordinates of a vector specified in barycentric coordinates and relative to 4d-triangle. More...
 
static Vector4 CatmullRom (Vector4 value1, Vector4 value2, Vector4 value3, Vector4 value4, float amount)
 Creates a new Vector4 that contains CatmullRom interpolation of the specified vectors. More...
 
static void CatmullRom (ref Vector4 value1, ref Vector4 value2, ref Vector4 value3, ref Vector4 value4, float amount, out Vector4 result)
 Creates a new Vector4 that contains CatmullRom interpolation of the specified vectors. More...
 
static Vector4 Clamp (Vector4 value1, Vector4 min, Vector4 max)
 Clamps the specified value within a range. More...
 
static void Clamp (ref Vector4 value1, ref Vector4 min, ref Vector4 max, out Vector4 result)
 Clamps the specified value within a range. More...
 
static float Distance (Vector4 value1, Vector4 value2)
 Returns the distance between two vectors. More...
 
static void Distance (ref Vector4 value1, ref Vector4 value2, out float result)
 Returns the distance between two vectors. More...
 
static float DistanceSquared (Vector4 value1, Vector4 value2)
 Returns the squared distance between two vectors. More...
 
static void DistanceSquared (ref Vector4 value1, ref Vector4 value2, out float result)
 Returns the squared distance between two vectors. More...
 
static Vector4 Divide (Vector4 value1, Vector4 value2)
 Divides the components of a Vector4 by the components of another Vector4. More...
 
static Vector4 Divide (Vector4 value1, float divider)
 Divides the components of a Vector4 by a scalar. More...
 
static void Divide (ref Vector4 value1, float divider, out Vector4 result)
 Divides the components of a Vector4 by a scalar. More...
 
static void Divide (ref Vector4 value1, ref Vector4 value2, out Vector4 result)
 Divides the components of a Vector4 by the components of another Vector4. More...
 
static float Dot (Vector4 value1, Vector4 value2)
 Returns a dot product of two vectors. More...
 
static void Dot (ref Vector4 value1, ref Vector4 value2, out float result)
 Returns a dot product of two vectors. More...
 
static Vector4 Hermite (Vector4 value1, Vector4 tangent1, Vector4 value2, Vector4 tangent2, float amount)
 Creates a new Vector4 that contains hermite spline interpolation. More...
 
static void Hermite (ref Vector4 value1, ref Vector4 tangent1, ref Vector4 value2, ref Vector4 tangent2, float amount, out Vector4 result)
 Creates a new Vector4 that contains hermite spline interpolation. More...
 
static Vector4 Lerp (Vector4 value1, Vector4 value2, float amount)
 Creates a new Vector4 that contains linear interpolation of the specified vectors. More...
 
static void Lerp (ref Vector4 value1, ref Vector4 value2, float amount, out Vector4 result)
 Creates a new Vector4 that contains linear interpolation of the specified vectors. More...
 
static Vector4 LerpPrecise (Vector4 value1, Vector4 value2, float amount)
 Creates a new Vector4 that contains linear interpolation of the specified vectors. Uses MathHelper.LerpPrecise on MathHelper for the interpolation. Less efficient but more precise compared to Vector4.Lerp(Vector4, Vector4, float). See remarks section of MathHelper.LerpPrecise on MathHelper for more info. More...
 
static void LerpPrecise (ref Vector4 value1, ref Vector4 value2, float amount, out Vector4 result)
 Creates a new Vector4 that contains linear interpolation of the specified vectors. Uses MathHelper.LerpPrecise on MathHelper for the interpolation. Less efficient but more precise compared to Vector4.Lerp(ref Vector4, ref Vector4, float, out Vector4). See remarks section of MathHelper.LerpPrecise on MathHelper for more info. More...
 
static Vector4 Max (Vector4 value1, Vector4 value2)
 Creates a new Vector4 that contains a maximal values from the two vectors. More...
 
static void Max (ref Vector4 value1, ref Vector4 value2, out Vector4 result)
 Creates a new Vector4 that contains a maximal values from the two vectors. More...
 
static Vector4 Min (Vector4 value1, Vector4 value2)
 Creates a new Vector4 that contains a minimal values from the two vectors. More...
 
static void Min (ref Vector4 value1, ref Vector4 value2, out Vector4 result)
 Creates a new Vector4 that contains a minimal values from the two vectors. More...
 
static Vector4 Multiply (Vector4 value1, Vector4 value2)
 Creates a new Vector4 that contains a multiplication of two vectors. More...
 
static Vector4 Multiply (Vector4 value1, float scaleFactor)
 Creates a new Vector4 that contains a multiplication of Vector4 and a scalar. More...
 
static void Multiply (ref Vector4 value1, float scaleFactor, out Vector4 result)
 Creates a new Vector4 that contains a multiplication of Vector4 and a scalar. More...
 
static void Multiply (ref Vector4 value1, ref Vector4 value2, out Vector4 result)
 Creates a new Vector4 that contains a multiplication of two vectors. More...
 
static Vector4 Negate (Vector4 value)
 Creates a new Vector4 that contains the specified vector inversion. More...
 
static void Negate (ref Vector4 value, out Vector4 result)
 Creates a new Vector4 that contains the specified vector inversion. More...
 
static Vector4 Normalize (Vector4 value)
 Creates a new Vector4 that contains a normalized values from another vector. More...
 
static void Normalize (ref Vector4 value, out Vector4 result)
 Creates a new Vector4 that contains a normalized values from another vector. More...
 
static Vector4 SmoothStep (Vector4 value1, Vector4 value2, float amount)
 Creates a new Vector4 that contains cubic interpolation of the specified vectors. More...
 
static void SmoothStep (ref Vector4 value1, ref Vector4 value2, float amount, out Vector4 result)
 Creates a new Vector4 that contains cubic interpolation of the specified vectors. More...
 
static Vector4 Subtract (Vector4 value1, Vector4 value2)
 Creates a new Vector4 that contains subtraction of on Vector4 from a another. More...
 
static void Subtract (ref Vector4 value1, ref Vector4 value2, out Vector4 result)
 Creates a new Vector4 that contains subtraction of on Vector4 from a another. More...
 
static Vector4 Transform (Vector2 value, Matrix matrix)
 Creates a new Vector4 that contains a transformation of 2d-vector by the specified Matrix. More...
 
static Vector4 Transform (Vector2 value, Quaternion rotation)
 Creates a new Vector4 that contains a transformation of 2d-vector by the specified Quaternion. More...
 
static Vector4 Transform (Vector3 value, Matrix matrix)
 Creates a new Vector4 that contains a transformation of 3d-vector by the specified Matrix. More...
 
static Vector4 Transform (Vector3 value, Quaternion rotation)
 Creates a new Vector4 that contains a transformation of 3d-vector by the specified Quaternion. More...
 
static Vector4 Transform (Vector4 value, Matrix matrix)
 Creates a new Vector4 that contains a transformation of 4d-vector by the specified Matrix. More...
 
static Vector4 Transform (Vector4 value, Quaternion rotation)
 Creates a new Vector4 that contains a transformation of 4d-vector by the specified Quaternion. More...
 
static void Transform (ref Vector2 value, ref Matrix matrix, out Vector4 result)
 Creates a new Vector4 that contains a transformation of 2d-vector by the specified Matrix. More...
 
static void Transform (ref Vector2 value, ref Quaternion rotation, out Vector4 result)
 Creates a new Vector4 that contains a transformation of 2d-vector by the specified Quaternion. More...
 
static void Transform (ref Vector3 value, ref Matrix matrix, out Vector4 result)
 Creates a new Vector4 that contains a transformation of 3d-vector by the specified Matrix. More...
 
static void Transform (ref Vector3 value, ref Quaternion rotation, out Vector4 result)
 Creates a new Vector4 that contains a transformation of 3d-vector by the specified Quaternion. More...
 
static void Transform (ref Vector4 value, ref Matrix matrix, out Vector4 result)
 Creates a new Vector4 that contains a transformation of 4d-vector by the specified Matrix. More...
 
static void Transform (ref Vector4 value, ref Quaternion rotation, out Vector4 result)
 Creates a new Vector4 that contains a transformation of 4d-vector by the specified Quaternion. More...
 
static void Transform (Vector4[] sourceArray, int sourceIndex, ref Matrix matrix, Vector4[] destinationArray, int destinationIndex, int length)
 Apply transformation on vectors within array of Vector4 by the specified Matrix and places the results in an another array. More...
 
static void Transform (Vector4[] sourceArray, int sourceIndex, ref Quaternion rotation, Vector4[] destinationArray, int destinationIndex, int length)
 Apply transformation on vectors within array of Vector4 by the specified Quaternion and places the results in an another array. More...
 
static void Transform (Vector4[] sourceArray, ref Matrix matrix, Vector4[] destinationArray)
 Apply transformation on all vectors within array of Vector4 by the specified Matrix and places the results in an another array. More...
 
static void Transform (Vector4[] sourceArray, ref Quaternion rotation, Vector4[] destinationArray)
 Apply transformation on all vectors within array of Vector4 by the specified Quaternion and places the results in an another array. More...
 
static Vector4 operator- (Vector4 value)
 Inverts values in the specified Vector4. More...
 
static bool operator== (Vector4 value1, Vector4 value2)
 Compares whether two Vector4 instances are equal. More...
 
static bool operator!= (Vector4 value1, Vector4 value2)
 Compares whether two Vector4 instances are not equal. More...
 
static Vector4 operator+ (Vector4 value1, Vector4 value2)
 Adds two vectors. More...
 
static Vector4 operator- (Vector4 value1, Vector4 value2)
 Subtracts a Vector4 from a Vector4. More...
 
static Vector4 operator* (Vector4 value1, Vector4 value2)
 Multiplies the components of two vectors by each other. More...
 
static Vector4 operator* (Vector4 value, float scaleFactor)
 Multiplies the components of vector by a scalar. More...
 
static Vector4 operator* (float scaleFactor, Vector4 value)
 Multiplies the components of vector by a scalar. More...
 
static Vector4 operator/ (Vector4 value1, Vector4 value2)
 Divides the components of a Vector4 by the components of another Vector4. More...
 
static Vector4 operator/ (Vector4 value1, float divider)
 Divides the components of a Vector4 by a scalar. More...
 

Public Attributes

float X
 The x coordinate of this Vector4. More...
 
float Y
 The y coordinate of this Vector4. More...
 
float Z
 The z coordinate of this Vector4. More...
 
float W
 The w coordinate of this Vector4. More...
 

Static Public Attributes

static readonly int SizeInBytes = System.Runtime.InteropServices.Marshal.SizeOf(new Vector4())
 Defines the size of the Vector4 struct in bytes. More...
 

Properties

static Vector4 Zero [get]
 Returns a Vector4 with components 0, 0, 0, 0. More...
 
static Vector4 One [get]
 Returns a Vector4 with components 1, 1, 1, 1. More...
 
static Vector4 UnitX [get]
 Returns a Vector4 with components 1, 0, 0, 0. More...
 
static Vector4 UnitY [get]
 Returns a Vector4 with components 0, 1, 0, 0. More...
 
static Vector4 UnitZ [get]
 Returns a Vector4 with components 0, 0, 1, 0. More...
 
static Vector4 UnitW [get]
 Returns a Vector4 with components 0, 0, 0, 1. More...
 

Detailed Description

Describes a 4D-vector.

Definition at line 12 of file Vector4.cs.

Constructor & Destructor Documentation

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

Constructs a 3d vector with X, Y, Z and W from four values.

Parameters
xThe x coordinate in 4d-space.
yThe y coordinate in 4d-space.
zThe z coordinate in 4d-space.
wThe w coordinate in 4d-space.

Definition at line 118 of file Vector4.cs.

Shift.Vector4.Vector4 ( Vector2  value,
float  z,
float  w 
)
inline

Constructs a 3d vector with X and Z from Vector2 and Z and W from the scalars.

Parameters
valueThe x and y coordinates in 4d-space.
zThe z coordinate in 4d-space.
wThe w coordinate in 4d-space.

Definition at line 132 of file Vector4.cs.

Shift.Vector4.Vector4 ( Vector3  value,
float  w 
)
inline

Constructs a 3d vector with X, Y, Z from Vector3 and W from a scalar.

Parameters
valueThe x, y and z coordinates in 4d-space.
wThe w coordinate in 4d-space.

Definition at line 145 of file Vector4.cs.

Shift.Vector4.Vector4 ( float  value)
inline

Constructs a 4d vector with X, Y, Z and W set to the same value.

Parameters
valueThe x, y, z and w coordinates in 4d-space.

Definition at line 157 of file Vector4.cs.

Member Function Documentation

static Vector4 Shift.Vector4.Add ( Vector4  value1,
Vector4  value2 
)
inlinestatic

Performs vector addition on value1 and value2 .

Parameters
value1The first vector to add.
value2The second vector to add.
Returns
The result of the vector addition.

Definition at line 171 of file Vector4.cs.

static void Shift.Vector4.Add ( ref Vector4  value1,
ref Vector4  value2,
out Vector4  result 
)
inlinestatic

Performs vector addition on value1 and value2 , storing the result of the addition in result .

Parameters
value1The first vector to add.
value2The second vector to add.
resultThe result of the vector addition.

Definition at line 188 of file Vector4.cs.

static Vector4 Shift.Vector4.Barycentric ( Vector4  value1,
Vector4  value2,
Vector4  value3,
float  amount1,
float  amount2 
)
inlinestatic

Creates a new Vector4 that contains the cartesian coordinates of a vector specified in barycentric coordinates and relative to 4d-triangle.

Parameters
value1The first vector of 4d-triangle.
value2The second vector of 4d-triangle.
value3The third vector of 4d-triangle.
amount1Barycentric scalar b2 which represents a weighting factor towards second vector of 4d-triangle.
amount2Barycentric scalar b3 which represents a weighting factor towards third vector of 4d-triangle.
Returns
The cartesian translation of barycentric coordinates.

Definition at line 205 of file Vector4.cs.

static void Shift.Vector4.Barycentric ( ref Vector4  value1,
ref Vector4  value2,
ref Vector4  value3,
float  amount1,
float  amount2,
out Vector4  result 
)
inlinestatic

Creates a new Vector4 that contains the cartesian coordinates of a vector specified in barycentric coordinates and relative to 4d-triangle.

Parameters
value1The first vector of 4d-triangle.
value2The second vector of 4d-triangle.
value3The third vector of 4d-triangle.
amount1Barycentric scalar b2 which represents a weighting factor towards second vector of 4d-triangle.
amount2Barycentric scalar b3 which represents a weighting factor towards third vector of 4d-triangle.
resultThe cartesian translation of barycentric coordinates as an output parameter.

Definition at line 223 of file Vector4.cs.

static Vector4 Shift.Vector4.CatmullRom ( Vector4  value1,
Vector4  value2,
Vector4  value3,
Vector4  value4,
float  amount 
)
inlinestatic

Creates a new Vector4 that contains CatmullRom interpolation of the specified vectors.

Parameters
value1The first vector in interpolation.
value2The second vector in interpolation.
value3The third vector in interpolation.
value4The fourth vector in interpolation.
amountWeighting factor.
Returns
The result of CatmullRom interpolation.

Definition at line 240 of file Vector4.cs.

static void Shift.Vector4.CatmullRom ( ref Vector4  value1,
ref Vector4  value2,
ref Vector4  value3,
ref Vector4  value4,
float  amount,
out Vector4  result 
)
inlinestatic

Creates a new Vector4 that contains CatmullRom interpolation of the specified vectors.

Parameters
value1The first vector in interpolation.
value2The second vector in interpolation.
value3The third vector in interpolation.
value4The fourth vector in interpolation.
amountWeighting factor.
resultThe result of CatmullRom interpolation as an output parameter.

Definition at line 258 of file Vector4.cs.

static Vector4 Shift.Vector4.Clamp ( Vector4  value1,
Vector4  min,
Vector4  max 
)
inlinestatic

Clamps the specified value within a range.

Parameters
value1The value to clamp.
minThe min value.
maxThe max value.
Returns
The clamped value.

Definition at line 273 of file Vector4.cs.

static void Shift.Vector4.Clamp ( ref Vector4  value1,
ref Vector4  min,
ref Vector4  max,
out Vector4  result 
)
inlinestatic

Clamps the specified value within a range.

Parameters
value1The value to clamp.
minThe min value.
maxThe max value.
resultThe clamped value as an output parameter.

Definition at line 289 of file Vector4.cs.

static float Shift.Vector4.Distance ( Vector4  value1,
Vector4  value2 
)
inlinestatic

Returns the distance between two vectors.

Parameters
value1The first vector.
value2The second vector.
Returns
The distance between two vectors.

Definition at line 303 of file Vector4.cs.

static void Shift.Vector4.Distance ( ref Vector4  value1,
ref Vector4  value2,
out float  result 
)
inlinestatic

Returns the distance between two vectors.

Parameters
value1The first vector.
value2The second vector.
resultThe distance between two vectors as an output parameter.

Definition at line 314 of file Vector4.cs.

static float Shift.Vector4.DistanceSquared ( Vector4  value1,
Vector4  value2 
)
inlinestatic

Returns the squared distance between two vectors.

Parameters
value1The first vector.
value2The second vector.
Returns
The squared distance between two vectors.

Definition at line 325 of file Vector4.cs.

static void Shift.Vector4.DistanceSquared ( ref Vector4  value1,
ref Vector4  value2,
out float  result 
)
inlinestatic

Returns the squared distance between two vectors.

Parameters
value1The first vector.
value2The second vector.
resultThe squared distance between two vectors as an output parameter.

Definition at line 339 of file Vector4.cs.

static Vector4 Shift.Vector4.Divide ( Vector4  value1,
Vector4  value2 
)
inlinestatic

Divides the components of a Vector4 by the components of another Vector4.

Parameters
value1Source Vector4.
value2Divisor Vector4.
Returns
The result of dividing the vectors.

Definition at line 353 of file Vector4.cs.

static Vector4 Shift.Vector4.Divide ( Vector4  value1,
float  divider 
)
inlinestatic

Divides the components of a Vector4 by a scalar.

Parameters
value1Source Vector4.
dividerDivisor scalar.
Returns
The result of dividing a vector by a scalar.

Definition at line 368 of file Vector4.cs.

static void Shift.Vector4.Divide ( ref Vector4  value1,
float  divider,
out Vector4  result 
)
inlinestatic

Divides the components of a Vector4 by a scalar.

Parameters
value1Source Vector4.
dividerDivisor scalar.
resultThe result of dividing a vector by a scalar as an output parameter.

Definition at line 384 of file Vector4.cs.

static void Shift.Vector4.Divide ( ref Vector4  value1,
ref Vector4  value2,
out Vector4  result 
)
inlinestatic

Divides the components of a Vector4 by the components of another Vector4.

Parameters
value1Source Vector4.
value2Divisor Vector4.
resultThe result of dividing the vectors as an output parameter.

Definition at line 399 of file Vector4.cs.

static float Shift.Vector4.Dot ( Vector4  value1,
Vector4  value2 
)
inlinestatic

Returns a dot product of two vectors.

Parameters
value1The first vector.
value2The second vector.
Returns
The dot product of two vectors.

Definition at line 413 of file Vector4.cs.

static void Shift.Vector4.Dot ( ref Vector4  value1,
ref Vector4  value2,
out float  result 
)
inlinestatic

Returns a dot product of two vectors.

Parameters
value1The first vector.
value2The second vector.
resultThe dot product of two vectors as an output parameter.

Definition at line 424 of file Vector4.cs.

override bool Shift.Vector4.Equals ( object  obj)
inline

Compares whether current instance is equal to specified Object.

Parameters
objThe Object to compare.
Returns
true if the instances are equal; false otherwise.

Definition at line 434 of file Vector4.cs.

bool Shift.Vector4.Equals ( Vector4  other)
inline

Compares whether current instance is equal to specified Vector4.

Parameters
otherThe Vector4 to compare.
Returns
true if the instances are equal; false otherwise.

Definition at line 444 of file Vector4.cs.

override int Shift.Vector4.GetHashCode ( )
inline

Gets the hash code of this Vector4.

Returns
Hash code of this Vector4.

Definition at line 456 of file Vector4.cs.

static Vector4 Shift.Vector4.Hermite ( Vector4  value1,
Vector4  tangent1,
Vector4  value2,
Vector4  tangent2,
float  amount 
)
inlinestatic

Creates a new Vector4 that contains hermite spline interpolation.

Parameters
value1The first position vector.
tangent1The first tangent vector.
value2The second position vector.
tangent2The second tangent vector.
amountWeighting factor.
Returns
The hermite spline interpolation vector.

Definition at line 470 of file Vector4.cs.

static void Shift.Vector4.Hermite ( ref Vector4  value1,
ref Vector4  tangent1,
ref Vector4  value2,
ref Vector4  tangent2,
float  amount,
out Vector4  result 
)
inlinestatic

Creates a new Vector4 that contains hermite spline interpolation.

Parameters
value1The first position vector.
tangent1The first tangent vector.
value2The second position vector.
tangent2The second tangent vector.
amountWeighting factor.
resultThe hermite spline interpolation vector as an output parameter.

Definition at line 487 of file Vector4.cs.

float Shift.Vector4.Length ( )
inline

Returns the length of this Vector4.

Returns
The length of this Vector4.

Definition at line 499 of file Vector4.cs.

float Shift.Vector4.LengthSquared ( )
inline

Returns the squared length of this Vector4.

Returns
The squared length of this Vector4.

Definition at line 509 of file Vector4.cs.

static Vector4 Shift.Vector4.Lerp ( Vector4  value1,
Vector4  value2,
float  amount 
)
inlinestatic

Creates a new Vector4 that contains linear interpolation of the specified vectors.

Parameters
value1The first vector.
value2The second vector.
amountWeighting value(between 0.0 and 1.0).
Returns
The result of linear interpolation of the specified vectors.

Definition at line 521 of file Vector4.cs.

static void Shift.Vector4.Lerp ( ref Vector4  value1,
ref Vector4  value2,
float  amount,
out Vector4  result 
)
inlinestatic

Creates a new Vector4 that contains linear interpolation of the specified vectors.

Parameters
value1The first vector.
value2The second vector.
amountWeighting value(between 0.0 and 1.0).
resultThe result of linear interpolation of the specified vectors as an output parameter.

Definition at line 537 of file Vector4.cs.

static Vector4 Shift.Vector4.LerpPrecise ( Vector4  value1,
Vector4  value2,
float  amount 
)
inlinestatic

Creates a new Vector4 that contains linear interpolation of the specified vectors. Uses MathHelper.LerpPrecise on MathHelper for the interpolation. Less efficient but more precise compared to Vector4.Lerp(Vector4, Vector4, float). See remarks section of MathHelper.LerpPrecise on MathHelper for more info.

Parameters
value1The first vector.
value2The second vector.
amountWeighting value(between 0.0 and 1.0).
Returns
The result of linear interpolation of the specified vectors.

Definition at line 555 of file Vector4.cs.

static void Shift.Vector4.LerpPrecise ( ref Vector4  value1,
ref Vector4  value2,
float  amount,
out Vector4  result 
)
inlinestatic

Creates a new Vector4 that contains linear interpolation of the specified vectors. Uses MathHelper.LerpPrecise on MathHelper for the interpolation. Less efficient but more precise compared to Vector4.Lerp(ref Vector4, ref Vector4, float, out Vector4). See remarks section of MathHelper.LerpPrecise on MathHelper for more info.

Parameters
value1The first vector.
value2The second vector.
amountWeighting value(between 0.0 and 1.0).
resultThe result of linear interpolation of the specified vectors as an output parameter.

Definition at line 574 of file Vector4.cs.

static Vector4 Shift.Vector4.Max ( Vector4  value1,
Vector4  value2 
)
inlinestatic

Creates a new Vector4 that contains a maximal values from the two vectors.

Parameters
value1The first vector.
value2The second vector.
Returns
The Vector4 with maximal values from the two vectors.

Definition at line 588 of file Vector4.cs.

static void Shift.Vector4.Max ( ref Vector4  value1,
ref Vector4  value2,
out Vector4  result 
)
inlinestatic

Creates a new Vector4 that contains a maximal values from the two vectors.

Parameters
value1The first vector.
value2The second vector.
resultThe Vector4 with maximal values from the two vectors as an output parameter.

Definition at line 603 of file Vector4.cs.

static Vector4 Shift.Vector4.Min ( Vector4  value1,
Vector4  value2 
)
inlinestatic

Creates a new Vector4 that contains a minimal values from the two vectors.

Parameters
value1The first vector.
value2The second vector.
Returns
The Vector4 with minimal values from the two vectors.

Definition at line 617 of file Vector4.cs.

static void Shift.Vector4.Min ( ref Vector4  value1,
ref Vector4  value2,
out Vector4  result 
)
inlinestatic

Creates a new Vector4 that contains a minimal values from the two vectors.

Parameters
value1The first vector.
value2The second vector.
resultThe Vector4 with minimal values from the two vectors as an output parameter.

Definition at line 632 of file Vector4.cs.

static Vector4 Shift.Vector4.Multiply ( Vector4  value1,
Vector4  value2 
)
inlinestatic

Creates a new Vector4 that contains a multiplication of two vectors.

Parameters
value1Source Vector4.
value2Source Vector4.
Returns
The result of the vector multiplication.

Definition at line 646 of file Vector4.cs.

static Vector4 Shift.Vector4.Multiply ( Vector4  value1,
float  scaleFactor 
)
inlinestatic

Creates a new Vector4 that contains a multiplication of Vector4 and a scalar.

Parameters
value1Source Vector4.
scaleFactorScalar value.
Returns
The result of the vector multiplication with a scalar.

Definition at line 661 of file Vector4.cs.

static void Shift.Vector4.Multiply ( ref Vector4  value1,
float  scaleFactor,
out Vector4  result 
)
inlinestatic

Creates a new Vector4 that contains a multiplication of Vector4 and a scalar.

Parameters
value1Source Vector4.
scaleFactorScalar value.
resultThe result of the multiplication with a scalar as an output parameter.

Definition at line 676 of file Vector4.cs.

static void Shift.Vector4.Multiply ( ref Vector4  value1,
ref Vector4  value2,
out Vector4  result 
)
inlinestatic

Creates a new Vector4 that contains a multiplication of two vectors.

Parameters
value1Source Vector4.
value2Source Vector4.
resultThe result of the vector multiplication as an output parameter.

Definition at line 690 of file Vector4.cs.

static Vector4 Shift.Vector4.Negate ( Vector4  value)
inlinestatic

Creates a new Vector4 that contains the specified vector inversion.

Parameters
valueSource Vector4.
Returns
The result of the vector inversion.

Definition at line 703 of file Vector4.cs.

static void Shift.Vector4.Negate ( ref Vector4  value,
out Vector4  result 
)
inlinestatic

Creates a new Vector4 that contains the specified vector inversion.

Parameters
valueSource Vector4.
resultThe result of the vector inversion as an output parameter.

Definition at line 714 of file Vector4.cs.

void Shift.Vector4.Normalize ( )
inline

Turns this Vector4 to a unit vector with the same direction.

Definition at line 725 of file Vector4.cs.

static Vector4 Shift.Vector4.Normalize ( Vector4  value)
inlinestatic

Creates a new Vector4 that contains a normalized values from another vector.

Parameters
valueSource Vector4.
Returns
Unit vector.

Definition at line 735 of file Vector4.cs.

static void Shift.Vector4.Normalize ( ref Vector4  value,
out Vector4  result 
)
inlinestatic

Creates a new Vector4 that contains a normalized values from another vector.

Parameters
valueSource Vector4.
resultUnit vector as an output parameter.

Definition at line 748 of file Vector4.cs.

static bool Shift.Vector4.operator!= ( Vector4  value1,
Vector4  value2 
)
inlinestatic

Compares whether two Vector4 instances are not equal.

Parameters
value1Vector4 instance on the left of the not equal sign.
value2Vector4 instance on the right of the not equal sign.
Returns
true if the instances are not equal; false otherwise.

Definition at line 1128 of file Vector4.cs.

static Vector4 Shift.Vector4.operator* ( Vector4  value1,
Vector4  value2 
)
inlinestatic

Multiplies the components of two vectors by each other.

Parameters
value1Source Vector4 on the left of the mul sign.
value2Source Vector4 on the right of the mul sign.
Returns
Result of the vector multiplication.

Definition at line 1169 of file Vector4.cs.

static Vector4 Shift.Vector4.operator* ( Vector4  value,
float  scaleFactor 
)
inlinestatic

Multiplies the components of vector by a scalar.

Parameters
valueSource Vector4 on the left of the mul sign.
scaleFactorScalar value on the right of the mul sign.
Returns
Result of the vector multiplication with a scalar.

Definition at line 1184 of file Vector4.cs.

static Vector4 Shift.Vector4.operator* ( float  scaleFactor,
Vector4  value 
)
inlinestatic

Multiplies the components of vector by a scalar.

Parameters
scaleFactorScalar value on the left of the mul sign.
valueSource Vector4 on the right of the mul sign.
Returns
Result of the vector multiplication with a scalar.

Definition at line 1199 of file Vector4.cs.

static Vector4 Shift.Vector4.operator+ ( Vector4  value1,
Vector4  value2 
)
inlinestatic

Adds two vectors.

Parameters
value1Source Vector4 on the left of the add sign.
value2Source Vector4 on the right of the add sign.
Returns
Sum of the vectors.

Definition at line 1139 of file Vector4.cs.

static Vector4 Shift.Vector4.operator- ( Vector4  value)
inlinestatic

Inverts values in the specified Vector4.

Parameters
valueSource Vector4 on the right of the sub sign.
Returns
Result of the inversion.

Definition at line 1103 of file Vector4.cs.

static Vector4 Shift.Vector4.operator- ( Vector4  value1,
Vector4  value2 
)
inlinestatic

Subtracts a Vector4 from a Vector4.

Parameters
value1Source Vector4 on the left of the sub sign.
value2Source Vector4 on the right of the sub sign.
Returns
Result of the vector subtraction.

Definition at line 1154 of file Vector4.cs.

static Vector4 Shift.Vector4.operator/ ( Vector4  value1,
Vector4  value2 
)
inlinestatic

Divides the components of a Vector4 by the components of another Vector4.

Parameters
value1Source Vector4 on the left of the div sign.
value2Divisor Vector4 on the right of the div sign.
Returns
The result of dividing the vectors.

Definition at line 1214 of file Vector4.cs.

static Vector4 Shift.Vector4.operator/ ( Vector4  value1,
float  divider 
)
inlinestatic

Divides the components of a Vector4 by a scalar.

Parameters
value1Source Vector4 on the left of the div sign.
dividerDivisor scalar on the right of the div sign.
Returns
The result of dividing a vector by a scalar.

Definition at line 1229 of file Vector4.cs.

static bool Shift.Vector4.operator== ( Vector4  value1,
Vector4  value2 
)
inlinestatic

Compares whether two Vector4 instances are equal.

Parameters
value1Vector4 instance on the left of the equal sign.
value2Vector4 instance on the right of the equal sign.
Returns
true if the instances are equal; false otherwise.

Definition at line 1114 of file Vector4.cs.

static Vector4 Shift.Vector4.SmoothStep ( Vector4  value1,
Vector4  value2,
float  amount 
)
inlinestatic

Creates a new Vector4 that contains cubic interpolation of the specified vectors.

Parameters
value1Source Vector4.
value2Source Vector4.
amountWeighting value.
Returns
Cubic interpolation of the specified vectors.

Definition at line 766 of file Vector4.cs.

static void Shift.Vector4.SmoothStep ( ref Vector4  value1,
ref Vector4  value2,
float  amount,
out Vector4  result 
)
inlinestatic

Creates a new Vector4 that contains cubic interpolation of the specified vectors.

Parameters
value1Source Vector4.
value2Source Vector4.
amountWeighting value.
resultCubic interpolation of the specified vectors as an output parameter.

Definition at line 782 of file Vector4.cs.

static Vector4 Shift.Vector4.Subtract ( Vector4  value1,
Vector4  value2 
)
inlinestatic

Creates a new Vector4 that contains subtraction of on Vector4 from a another.

Parameters
value1Source Vector4.
value2Source Vector4.
Returns
The result of the vector subtraction.

Definition at line 796 of file Vector4.cs.

static void Shift.Vector4.Subtract ( ref Vector4  value1,
ref Vector4  value2,
out Vector4  result 
)
inlinestatic

Creates a new Vector4 that contains subtraction of on Vector4 from a another.

Parameters
value1Source Vector4.
value2Source Vector4.
resultThe result of the vector subtraction as an output parameter.

Definition at line 811 of file Vector4.cs.

override string Shift.Vector4.ToString ( )
inline

Returns a String representation of this Vector4 in the format: {X:[X] Y:[Y] Z:[Z] W:[W]}

Returns
A String representation of this Vector4.

Definition at line 1093 of file Vector4.cs.

static Vector4 Shift.Vector4.Transform ( Vector2  value,
Matrix  matrix 
)
inlinestatic

Creates a new Vector4 that contains a transformation of 2d-vector by the specified Matrix.

Parameters
valueSource Vector2.
matrixThe transformation Matrix.
Returns
Transformed Vector4.

Definition at line 825 of file Vector4.cs.

static Vector4 Shift.Vector4.Transform ( Vector2  value,
Quaternion  rotation 
)
inlinestatic

Creates a new Vector4 that contains a transformation of 2d-vector by the specified Quaternion.

Parameters
valueSource Vector2.
rotationThe Quaternion which contains rotation transformation.
Returns
Transformed Vector4.

Definition at line 838 of file Vector4.cs.

static Vector4 Shift.Vector4.Transform ( Vector3  value,
Matrix  matrix 
)
inlinestatic

Creates a new Vector4 that contains a transformation of 3d-vector by the specified Matrix.

Parameters
valueSource Vector3.
matrixThe transformation Matrix.
Returns
Transformed Vector4.

Definition at line 851 of file Vector4.cs.

static Vector4 Shift.Vector4.Transform ( Vector3  value,
Quaternion  rotation 
)
inlinestatic

Creates a new Vector4 that contains a transformation of 3d-vector by the specified Quaternion.

Parameters
valueSource Vector3.
rotationThe Quaternion which contains rotation transformation.
Returns
Transformed Vector4.

Definition at line 864 of file Vector4.cs.

static Vector4 Shift.Vector4.Transform ( Vector4  value,
Matrix  matrix 
)
inlinestatic

Creates a new Vector4 that contains a transformation of 4d-vector by the specified Matrix.

Parameters
valueSource Vector4.
matrixThe transformation Matrix.
Returns
Transformed Vector4.

Definition at line 877 of file Vector4.cs.

static Vector4 Shift.Vector4.Transform ( Vector4  value,
Quaternion  rotation 
)
inlinestatic

Creates a new Vector4 that contains a transformation of 4d-vector by the specified Quaternion.

Parameters
valueSource Vector4.
rotationThe Quaternion which contains rotation transformation.
Returns
Transformed Vector4.

Definition at line 889 of file Vector4.cs.

static void Shift.Vector4.Transform ( ref Vector2  value,
ref Matrix  matrix,
out Vector4  result 
)
inlinestatic

Creates a new Vector4 that contains a transformation of 2d-vector by the specified Matrix.

Parameters
valueSource Vector2.
matrixThe transformation Matrix.
resultTransformed Vector4 as an output parameter.

Definition at line 902 of file Vector4.cs.

static void Shift.Vector4.Transform ( ref Vector2  value,
ref Quaternion  rotation,
out Vector4  result 
)
inlinestatic

Creates a new Vector4 that contains a transformation of 2d-vector by the specified Quaternion.

Parameters
valueSource Vector2.
rotationThe Quaternion which contains rotation transformation.
resultTransformed Vector4 as an output parameter.

Definition at line 916 of file Vector4.cs.

static void Shift.Vector4.Transform ( ref Vector3  value,
ref Matrix  matrix,
out Vector4  result 
)
inlinestatic

Creates a new Vector4 that contains a transformation of 3d-vector by the specified Matrix.

Parameters
valueSource Vector3.
matrixThe transformation Matrix.
resultTransformed Vector4 as an output parameter.

Definition at line 927 of file Vector4.cs.

static void Shift.Vector4.Transform ( ref Vector3  value,
ref Quaternion  rotation,
out Vector4  result 
)
inlinestatic

Creates a new Vector4 that contains a transformation of 3d-vector by the specified Quaternion.

Parameters
valueSource Vector3.
rotationThe Quaternion which contains rotation transformation.
resultTransformed Vector4 as an output parameter.

Definition at line 941 of file Vector4.cs.

static void Shift.Vector4.Transform ( ref Vector4  value,
ref Matrix  matrix,
out Vector4  result 
)
inlinestatic

Creates a new Vector4 that contains a transformation of 4d-vector by the specified Matrix.

Parameters
valueSource Vector4.
matrixThe transformation Matrix.
resultTransformed Vector4 as an output parameter.

Definition at line 952 of file Vector4.cs.

static void Shift.Vector4.Transform ( ref Vector4  value,
ref Quaternion  rotation,
out Vector4  result 
)
inlinestatic

Creates a new Vector4 that contains a transformation of 4d-vector by the specified Quaternion.

Parameters
valueSource Vector4.
rotationThe Quaternion which contains rotation transformation.
resultTransformed Vector4 as an output parameter.

Definition at line 970 of file Vector4.cs.

static void Shift.Vector4.Transform ( Vector4[]  sourceArray,
int  sourceIndex,
ref Matrix  matrix,
Vector4[]  destinationArray,
int  destinationIndex,
int  length 
)
inlinestatic

Apply transformation on vectors within array of Vector4 by the specified Matrix and places the results in an another array.

Parameters
sourceArraySource array.
sourceIndexThe starting index of transformation in the source array.
matrixThe transformation Matrix.
destinationArrayDestination array.
destinationIndexThe starting index in the destination array, where the first Vector4 should be written.
lengthThe number of vectors to be transformed.

Definition at line 985 of file Vector4.cs.

static void Shift.Vector4.Transform ( Vector4[]  sourceArray,
int  sourceIndex,
ref Quaternion  rotation,
Vector4[]  destinationArray,
int  destinationIndex,
int  length 
)
inlinestatic

Apply transformation on vectors within array of Vector4 by the specified Quaternion and places the results in an another array.

Parameters
sourceArraySource array.
sourceIndexThe starting index of transformation in the source array.
rotationThe Quaternion which contains rotation transformation.
destinationArrayDestination array.
destinationIndexThe starting index in the destination array, where the first Vector4 should be written.
lengthThe number of vectors to be transformed.

Definition at line 1019 of file Vector4.cs.

static void Shift.Vector4.Transform ( Vector4[]  sourceArray,
ref Matrix  matrix,
Vector4[]  destinationArray 
)
inlinestatic

Apply transformation on all vectors within array of Vector4 by the specified Matrix and places the results in an another array.

Parameters
sourceArraySource array.
matrixThe transformation Matrix.
destinationArrayDestination array.

Definition at line 1050 of file Vector4.cs.

static void Shift.Vector4.Transform ( Vector4[]  sourceArray,
ref Quaternion  rotation,
Vector4[]  destinationArray 
)
inlinestatic

Apply transformation on all vectors within array of Vector4 by the specified Quaternion and places the results in an another array.

Parameters
sourceArraySource array.
rotationThe Quaternion which contains rotation transformation.
destinationArrayDestination array.

Definition at line 1072 of file Vector4.cs.

Member Data Documentation

readonly int Shift.Vector4.SizeInBytes = System.Runtime.InteropServices.Marshal.SizeOf(new Vector4())
static

Defines the size of the Vector4 struct in bytes.

Definition at line 17 of file Vector4.cs.

float Shift.Vector4.W

The w coordinate of this Vector4.

Definition at line 96 of file Vector4.cs.

float Shift.Vector4.X

The x coordinate of this Vector4.

Definition at line 78 of file Vector4.cs.

float Shift.Vector4.Y

The y coordinate of this Vector4.

Definition at line 84 of file Vector4.cs.

float Shift.Vector4.Z

The z coordinate of this Vector4.

Definition at line 90 of file Vector4.cs.

Property Documentation

Vector4 Shift.Vector4.One
staticget

Returns a Vector4 with components 1, 1, 1, 1.

Definition at line 38 of file Vector4.cs.

Vector4 Shift.Vector4.UnitW
staticget

Returns a Vector4 with components 0, 0, 0, 1.

Definition at line 70 of file Vector4.cs.

Vector4 Shift.Vector4.UnitX
staticget

Returns a Vector4 with components 1, 0, 0, 0.

Definition at line 46 of file Vector4.cs.

Vector4 Shift.Vector4.UnitY
staticget

Returns a Vector4 with components 0, 1, 0, 0.

Definition at line 54 of file Vector4.cs.

Vector4 Shift.Vector4.UnitZ
staticget

Returns a Vector4 with components 0, 0, 1, 0.

Definition at line 62 of file Vector4.cs.

Vector4 Shift.Vector4.Zero
staticget

Returns a Vector4 with components 0, 0, 0, 0.

Definition at line 30 of file Vector4.cs.


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