Table of Contents

Struct Vector4

Namespace
Microsoft.Xna.Framework
Assembly
MonoGame.Framework.dll

Describes a 4D-vector.

[TypeConverter(typeof(Vector4TypeConverter))]
[DataContract]
public struct Vector4 : IEquatable<Vector4>
Implements
Inherited Members

Constructors

Vector4(Vector2, float, float)

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

public Vector4(Vector2 value, float z, float w)

Parameters

value Vector2

The x and y coordinates in 4d-space.

z float

The z coordinate in 4d-space.

w float

The w coordinate in 4d-space.

Vector4(Vector3, float)

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

public Vector4(Vector3 value, float w)

Parameters

value Vector3

The x, y and z coordinates in 4d-space.

w float

The w coordinate in 4d-space.

Vector4(float)

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

public Vector4(float value)

Parameters

value float

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

Vector4(float, float, float, float)

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

public Vector4(float x, float y, float z, float w)

Parameters

x float

The x coordinate in 4d-space.

y float

The y coordinate in 4d-space.

z float

The z coordinate in 4d-space.

w float

The w coordinate in 4d-space.

Fields

W

The w coordinate of this Vector4.

[DataMember]
public float W

Field Value

float

X

The x coordinate of this Vector4.

[DataMember]
public float X

Field Value

float

Y

The y coordinate of this Vector4.

[DataMember]
public float Y

Field Value

float

Z

The z coordinate of this Vector4.

[DataMember]
public float Z

Field Value

float

Properties

One

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

public static Vector4 One { get; }

Property Value

Vector4

UnitW

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

public static Vector4 UnitW { get; }

Property Value

Vector4

UnitX

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

public static Vector4 UnitX { get; }

Property Value

Vector4

UnitY

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

public static Vector4 UnitY { get; }

Property Value

Vector4

UnitZ

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

public static Vector4 UnitZ { get; }

Property Value

Vector4

Zero

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

public static Vector4 Zero { get; }

Property Value

Vector4

Methods

Add(Vector4, Vector4)

Performs vector addition on value1 and value2.

public static Vector4 Add(Vector4 value1, Vector4 value2)

Parameters

value1 Vector4

The first vector to add.

value2 Vector4

The second vector to add.

Returns

Vector4

The result of the vector addition.

Add(ref Vector4, ref Vector4, out Vector4)

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

public static void Add(ref Vector4 value1, ref Vector4 value2, out Vector4 result)

Parameters

value1 Vector4

The first vector to add.

value2 Vector4

The second vector to add.

result Vector4

The result of the vector addition.

Barycentric(Vector4, Vector4, Vector4, float, float)

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

public static Vector4 Barycentric(Vector4 value1, Vector4 value2, Vector4 value3, float amount1, float amount2)

Parameters

value1 Vector4

The first vector of 4d-triangle.

value2 Vector4

The second vector of 4d-triangle.

value3 Vector4

The third vector of 4d-triangle.

amount1 float

Barycentric scalar b2 which represents a weighting factor towards second vector of 4d-triangle.

amount2 float

Barycentric scalar b3 which represents a weighting factor towards third vector of 4d-triangle.

Returns

Vector4

The cartesian translation of barycentric coordinates.

Barycentric(ref Vector4, ref Vector4, ref Vector4, float, float, out Vector4)

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

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

Parameters

value1 Vector4

The first vector of 4d-triangle.

value2 Vector4

The second vector of 4d-triangle.

value3 Vector4

The third vector of 4d-triangle.

amount1 float

Barycentric scalar b2 which represents a weighting factor towards second vector of 4d-triangle.

amount2 float

Barycentric scalar b3 which represents a weighting factor towards third vector of 4d-triangle.

result Vector4

The cartesian translation of barycentric coordinates as an output parameter.

CatmullRom(Vector4, Vector4, Vector4, Vector4, float)

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

public static Vector4 CatmullRom(Vector4 value1, Vector4 value2, Vector4 value3, Vector4 value4, float amount)

Parameters

value1 Vector4

The first vector in interpolation.

value2 Vector4

The second vector in interpolation.

value3 Vector4

The third vector in interpolation.

value4 Vector4

The fourth vector in interpolation.

amount float

Weighting factor.

Returns

Vector4

The result of CatmullRom interpolation.

CatmullRom(ref Vector4, ref Vector4, ref Vector4, ref Vector4, float, out Vector4)

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

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

Parameters

value1 Vector4

The first vector in interpolation.

value2 Vector4

The second vector in interpolation.

value3 Vector4

The third vector in interpolation.

value4 Vector4

The fourth vector in interpolation.

amount float

Weighting factor.

result Vector4

The result of CatmullRom interpolation as an output parameter.

Ceiling()

Round the members of this Vector4 towards positive infinity.

public void Ceiling()

Ceiling(Vector4)

Creates a new Vector4 that contains members from another vector rounded towards positive infinity.

public static Vector4 Ceiling(Vector4 value)

Parameters

value Vector4

Source Vector4.

Returns

Vector4

The rounded Vector4.

Ceiling(ref Vector4, out Vector4)

Creates a new Vector4 that contains members from another vector rounded towards positive infinity.

public static void Ceiling(ref Vector4 value, out Vector4 result)

Parameters

value Vector4

Source Vector4.

result Vector4

The rounded Vector4.

Clamp(Vector4, Vector4, Vector4)

Clamps the specified value within a range.

public static Vector4 Clamp(Vector4 value1, Vector4 min, Vector4 max)

Parameters

value1 Vector4

The value to clamp.

min Vector4

The min value.

max Vector4

The max value.

Returns

Vector4

The clamped value.

Clamp(ref Vector4, ref Vector4, ref Vector4, out Vector4)

Clamps the specified value within a range.

public static void Clamp(ref Vector4 value1, ref Vector4 min, ref Vector4 max, out Vector4 result)

Parameters

value1 Vector4

The value to clamp.

min Vector4

The min value.

max Vector4

The max value.

result Vector4

The clamped value as an output parameter.

Deconstruct(out float, out float, out float, out float)

Deconstruction method for Vector4.

public void Deconstruct(out float x, out float y, out float z, out float w)

Parameters

x float
y float
z float
w float

Distance(Vector4, Vector4)

Returns the distance between two vectors.

public static float Distance(Vector4 value1, Vector4 value2)

Parameters

value1 Vector4

The first vector.

value2 Vector4

The second vector.

Returns

float

The distance between two vectors.

Distance(ref Vector4, ref Vector4, out float)

Returns the distance between two vectors.

public static void Distance(ref Vector4 value1, ref Vector4 value2, out float result)

Parameters

value1 Vector4

The first vector.

value2 Vector4

The second vector.

result float

The distance between two vectors as an output parameter.

DistanceSquared(Vector4, Vector4)

Returns the squared distance between two vectors.

public static float DistanceSquared(Vector4 value1, Vector4 value2)

Parameters

value1 Vector4

The first vector.

value2 Vector4

The second vector.

Returns

float

The squared distance between two vectors.

DistanceSquared(ref Vector4, ref Vector4, out float)

Returns the squared distance between two vectors.

public static void DistanceSquared(ref Vector4 value1, ref Vector4 value2, out float result)

Parameters

value1 Vector4

The first vector.

value2 Vector4

The second vector.

result float

The squared distance between two vectors as an output parameter.

Divide(Vector4, Vector4)

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

public static Vector4 Divide(Vector4 value1, Vector4 value2)

Parameters

value1 Vector4

Source Vector4.

value2 Vector4

Divisor Vector4.

Returns

Vector4

The result of dividing the vectors.

Divide(Vector4, float)

Divides the components of a Vector4 by a scalar.

public static Vector4 Divide(Vector4 value1, float divider)

Parameters

value1 Vector4

Source Vector4.

divider float

Divisor scalar.

Returns

Vector4

The result of dividing a vector by a scalar.

Divide(ref Vector4, ref Vector4, out Vector4)

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

public static void Divide(ref Vector4 value1, ref Vector4 value2, out Vector4 result)

Parameters

value1 Vector4

Source Vector4.

value2 Vector4

Divisor Vector4.

result Vector4

The result of dividing the vectors as an output parameter.

Divide(ref Vector4, float, out Vector4)

Divides the components of a Vector4 by a scalar.

public static void Divide(ref Vector4 value1, float divider, out Vector4 result)

Parameters

value1 Vector4

Source Vector4.

divider float

Divisor scalar.

result Vector4

The result of dividing a vector by a scalar as an output parameter.

Dot(Vector4, Vector4)

Returns a dot product of two vectors.

public static float Dot(Vector4 value1, Vector4 value2)

Parameters

value1 Vector4

The first vector.

value2 Vector4

The second vector.

Returns

float

The dot product of two vectors.

Dot(ref Vector4, ref Vector4, out float)

Returns a dot product of two vectors.

public static void Dot(ref Vector4 value1, ref Vector4 value2, out float result)

Parameters

value1 Vector4

The first vector.

value2 Vector4

The second vector.

result float

The dot product of two vectors as an output parameter.

Equals(Vector4)

Compares whether current instance is equal to specified Vector4.

public bool Equals(Vector4 other)

Parameters

other Vector4

The Vector4 to compare.

Returns

bool

true if the instances are equal; false otherwise.

Equals(object)

Compares whether current instance is equal to specified object.

public override bool Equals(object obj)

Parameters

obj object

The object to compare.

Returns

bool

true if the instances are equal; false otherwise.

Floor()

Round the members of this Vector4 towards negative infinity.

public void Floor()

Floor(Vector4)

Creates a new Vector4 that contains members from another vector rounded towards negative infinity.

public static Vector4 Floor(Vector4 value)

Parameters

value Vector4

Source Vector4.

Returns

Vector4

The rounded Vector4.

Floor(ref Vector4, out Vector4)

Creates a new Vector4 that contains members from another vector rounded towards negative infinity.

public static void Floor(ref Vector4 value, out Vector4 result)

Parameters

value Vector4

Source Vector4.

result Vector4

The rounded Vector4.

GetHashCode()

Gets the hash code of this Vector4.

public override int GetHashCode()

Returns

int

Hash code of this Vector4.

Hermite(Vector4, Vector4, Vector4, Vector4, float)

Creates a new Vector4 that contains hermite spline interpolation.

public static Vector4 Hermite(Vector4 value1, Vector4 tangent1, Vector4 value2, Vector4 tangent2, float amount)

Parameters

value1 Vector4

The first position vector.

tangent1 Vector4

The first tangent vector.

value2 Vector4

The second position vector.

tangent2 Vector4

The second tangent vector.

amount float

Weighting factor.

Returns

Vector4

The hermite spline interpolation vector.

Hermite(ref Vector4, ref Vector4, ref Vector4, ref Vector4, float, out Vector4)

Creates a new Vector4 that contains hermite spline interpolation.

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

Parameters

value1 Vector4

The first position vector.

tangent1 Vector4

The first tangent vector.

value2 Vector4

The second position vector.

tangent2 Vector4

The second tangent vector.

amount float

Weighting factor.

result Vector4

The hermite spline interpolation vector as an output parameter.

Length()

Returns the length of this Vector4.

public float Length()

Returns

float

The length of this Vector4.

LengthSquared()

Returns the squared length of this Vector4.

public float LengthSquared()

Returns

float

The squared length of this Vector4.

Lerp(Vector4, Vector4, float)

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

public static Vector4 Lerp(Vector4 value1, Vector4 value2, float amount)

Parameters

value1 Vector4

The first vector.

value2 Vector4

The second vector.

amount float

Weighting value(between 0.0 and 1.0).

Returns

Vector4

The result of linear interpolation of the specified vectors.

Lerp(ref Vector4, ref Vector4, float, out Vector4)

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

public static void Lerp(ref Vector4 value1, ref Vector4 value2, float amount, out Vector4 result)

Parameters

value1 Vector4

The first vector.

value2 Vector4

The second vector.

amount float

Weighting value(between 0.0 and 1.0).

result Vector4

The result of linear interpolation of the specified vectors as an output parameter.

LerpPrecise(Vector4, Vector4, float)

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

public static Vector4 LerpPrecise(Vector4 value1, Vector4 value2, float amount)

Parameters

value1 Vector4

The first vector.

value2 Vector4

The second vector.

amount float

Weighting value(between 0.0 and 1.0).

Returns

Vector4

The result of linear interpolation of the specified vectors.

LerpPrecise(ref Vector4, ref Vector4, float, out Vector4)

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

public static void LerpPrecise(ref Vector4 value1, ref Vector4 value2, float amount, out Vector4 result)

Parameters

value1 Vector4

The first vector.

value2 Vector4

The second vector.

amount float

Weighting value(between 0.0 and 1.0).

result Vector4

The result of linear interpolation of the specified vectors as an output parameter.

Max(Vector4, Vector4)

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

public static Vector4 Max(Vector4 value1, Vector4 value2)

Parameters

value1 Vector4

The first vector.

value2 Vector4

The second vector.

Returns

Vector4

The Vector4 with maximal values from the two vectors.

Max(ref Vector4, ref Vector4, out Vector4)

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

public static void Max(ref Vector4 value1, ref Vector4 value2, out Vector4 result)

Parameters

value1 Vector4

The first vector.

value2 Vector4

The second vector.

result Vector4

The Vector4 with maximal values from the two vectors as an output parameter.

Min(Vector4, Vector4)

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

public static Vector4 Min(Vector4 value1, Vector4 value2)

Parameters

value1 Vector4

The first vector.

value2 Vector4

The second vector.

Returns

Vector4

The Vector4 with minimal values from the two vectors.

Min(ref Vector4, ref Vector4, out Vector4)

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

public static void Min(ref Vector4 value1, ref Vector4 value2, out Vector4 result)

Parameters

value1 Vector4

The first vector.

value2 Vector4

The second vector.

result Vector4

The Vector4 with minimal values from the two vectors as an output parameter.

Multiply(Vector4, Vector4)

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

public static Vector4 Multiply(Vector4 value1, Vector4 value2)

Parameters

value1 Vector4

Source Vector4.

value2 Vector4

Source Vector4.

Returns

Vector4

The result of the vector multiplication.

Multiply(Vector4, float)

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

public static Vector4 Multiply(Vector4 value1, float scaleFactor)

Parameters

value1 Vector4

Source Vector4.

scaleFactor float

Scalar value.

Returns

Vector4

The result of the vector multiplication with a scalar.

Multiply(ref Vector4, ref Vector4, out Vector4)

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

public static void Multiply(ref Vector4 value1, ref Vector4 value2, out Vector4 result)

Parameters

value1 Vector4

Source Vector4.

value2 Vector4

Source Vector4.

result Vector4

The result of the vector multiplication as an output parameter.

Multiply(ref Vector4, float, out Vector4)

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

public static void Multiply(ref Vector4 value1, float scaleFactor, out Vector4 result)

Parameters

value1 Vector4

Source Vector4.

scaleFactor float

Scalar value.

result Vector4

The result of the multiplication with a scalar as an output parameter.

Negate(Vector4)

Creates a new Vector4 that contains the specified vector inversion.

public static Vector4 Negate(Vector4 value)

Parameters

value Vector4

Source Vector4.

Returns

Vector4

The result of the vector inversion.

Negate(ref Vector4, out Vector4)

Creates a new Vector4 that contains the specified vector inversion.

public static void Negate(ref Vector4 value, out Vector4 result)

Parameters

value Vector4

Source Vector4.

result Vector4

The result of the vector inversion as an output parameter.

Normalize()

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

public void Normalize()

Normalize(Vector4)

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

public static Vector4 Normalize(Vector4 value)

Parameters

value Vector4

Source Vector4.

Returns

Vector4

Unit vector.

Normalize(ref Vector4, out Vector4)

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

public static void Normalize(ref Vector4 value, out Vector4 result)

Parameters

value Vector4

Source Vector4.

result Vector4

Unit vector as an output parameter.

Round()

Round the members of this Vector4 to the nearest integer value.

public void Round()

Round(Vector4)

Creates a new Vector4 that contains members from another vector rounded to the nearest integer value.

public static Vector4 Round(Vector4 value)

Parameters

value Vector4

Source Vector4.

Returns

Vector4

The rounded Vector4.

Round(ref Vector4, out Vector4)

Creates a new Vector4 that contains members from another vector rounded to the nearest integer value.

public static void Round(ref Vector4 value, out Vector4 result)

Parameters

value Vector4

Source Vector4.

result Vector4

The rounded Vector4.

SmoothStep(Vector4, Vector4, float)

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

public static Vector4 SmoothStep(Vector4 value1, Vector4 value2, float amount)

Parameters

value1 Vector4

Source Vector4.

value2 Vector4

Source Vector4.

amount float

Weighting value.

Returns

Vector4

Cubic interpolation of the specified vectors.

SmoothStep(ref Vector4, ref Vector4, float, out Vector4)

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

public static void SmoothStep(ref Vector4 value1, ref Vector4 value2, float amount, out Vector4 result)

Parameters

value1 Vector4

Source Vector4.

value2 Vector4

Source Vector4.

amount float

Weighting value.

result Vector4

Cubic interpolation of the specified vectors as an output parameter.

Subtract(Vector4, Vector4)

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

public static Vector4 Subtract(Vector4 value1, Vector4 value2)

Parameters

value1 Vector4

Source Vector4.

value2 Vector4

Source Vector4.

Returns

Vector4

The result of the vector subtraction.

Subtract(ref Vector4, ref Vector4, out Vector4)

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

public static void Subtract(ref Vector4 value1, ref Vector4 value2, out Vector4 result)

Parameters

value1 Vector4

Source Vector4.

value2 Vector4

Source Vector4.

result Vector4

The result of the vector subtraction as an output parameter.

ToNumerics()

Returns a Vector4.

public Vector4 ToNumerics()

Returns

Vector4

ToString()

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

public override string ToString()

Returns

string

A string representation of this Vector4.

Transform(Vector2, Matrix)

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

public static Vector4 Transform(Vector2 value, Matrix matrix)

Parameters

value Vector2

Source Vector2.

matrix Matrix

The transformation Matrix.

Returns

Vector4

Transformed Vector4.

Transform(Vector2, Quaternion)

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

public static Vector4 Transform(Vector2 value, Quaternion rotation)

Parameters

value Vector2

Source Vector2.

rotation Quaternion

The Quaternion which contains rotation transformation.

Returns

Vector4

Transformed Vector4.

Transform(ref Vector2, ref Matrix, out Vector4)

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

public static void Transform(ref Vector2 value, ref Matrix matrix, out Vector4 result)

Parameters

value Vector2

Source Vector2.

matrix Matrix

The transformation Matrix.

result Vector4

Transformed Vector4 as an output parameter.

Transform(ref Vector2, ref Quaternion, out Vector4)

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

public static void Transform(ref Vector2 value, ref Quaternion rotation, out Vector4 result)

Parameters

value Vector2

Source Vector2.

rotation Quaternion

The Quaternion which contains rotation transformation.

result Vector4

Transformed Vector4 as an output parameter.

Transform(Vector3, Matrix)

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

public static Vector4 Transform(Vector3 value, Matrix matrix)

Parameters

value Vector3

Source Vector3.

matrix Matrix

The transformation Matrix.

Returns

Vector4

Transformed Vector4.

Transform(Vector3, Quaternion)

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

public static Vector4 Transform(Vector3 value, Quaternion rotation)

Parameters

value Vector3

Source Vector3.

rotation Quaternion

The Quaternion which contains rotation transformation.

Returns

Vector4

Transformed Vector4.

Transform(ref Vector3, ref Matrix, out Vector4)

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

public static void Transform(ref Vector3 value, ref Matrix matrix, out Vector4 result)

Parameters

value Vector3

Source Vector3.

matrix Matrix

The transformation Matrix.

result Vector4

Transformed Vector4 as an output parameter.

Transform(ref Vector3, ref Quaternion, out Vector4)

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

public static void Transform(ref Vector3 value, ref Quaternion rotation, out Vector4 result)

Parameters

value Vector3

Source Vector3.

rotation Quaternion

The Quaternion which contains rotation transformation.

result Vector4

Transformed Vector4 as an output parameter.

Transform(Vector4, Matrix)

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

public static Vector4 Transform(Vector4 value, Matrix matrix)

Parameters

value Vector4

Source Vector4.

matrix Matrix

The transformation Matrix.

Returns

Vector4

Transformed Vector4.

Transform(Vector4, Quaternion)

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

public static Vector4 Transform(Vector4 value, Quaternion rotation)

Parameters

value Vector4

Source Vector4.

rotation Quaternion

The Quaternion which contains rotation transformation.

Returns

Vector4

Transformed Vector4.

Transform(ref Vector4, ref Matrix, out Vector4)

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

public static void Transform(ref Vector4 value, ref Matrix matrix, out Vector4 result)

Parameters

value Vector4

Source Vector4.

matrix Matrix

The transformation Matrix.

result Vector4

Transformed Vector4 as an output parameter.

Transform(ref Vector4, ref Quaternion, out Vector4)

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

public static void Transform(ref Vector4 value, ref Quaternion rotation, out Vector4 result)

Parameters

value Vector4

Source Vector4.

rotation Quaternion

The Quaternion which contains rotation transformation.

result Vector4

Transformed Vector4 as an output parameter.

Transform(Vector4[], ref Matrix, Vector4[])

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

public static void Transform(Vector4[] sourceArray, ref Matrix matrix, Vector4[] destinationArray)

Parameters

sourceArray Vector4[]

Source array.

matrix Matrix

The transformation Matrix.

destinationArray Vector4[]

Destination array.

Transform(Vector4[], ref Quaternion, Vector4[])

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

public static void Transform(Vector4[] sourceArray, ref Quaternion rotation, Vector4[] destinationArray)

Parameters

sourceArray Vector4[]

Source array.

rotation Quaternion

The Quaternion which contains rotation transformation.

destinationArray Vector4[]

Destination array.

Transform(Vector4[], int, ref Matrix, Vector4[], int, int)

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

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

Parameters

sourceArray Vector4[]

Source array.

sourceIndex int

The starting index of transformation in the source array.

matrix Matrix

The transformation Matrix.

destinationArray Vector4[]

Destination array.

destinationIndex int

The starting index in the destination array, where the first Vector4 should be written.

length int

The number of vectors to be transformed.

Transform(Vector4[], int, ref Quaternion, Vector4[], int, int)

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

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

Parameters

sourceArray Vector4[]

Source array.

sourceIndex int

The starting index of transformation in the source array.

rotation Quaternion

The Quaternion which contains rotation transformation.

destinationArray Vector4[]

Destination array.

destinationIndex int

The starting index in the destination array, where the first Vector4 should be written.

length int

The number of vectors to be transformed.

Operators

operator +(Vector4, Vector4)

Adds two vectors.

public static Vector4 operator +(Vector4 value1, Vector4 value2)

Parameters

value1 Vector4

Source Vector4 on the left of the add sign.

value2 Vector4

Source Vector4 on the right of the add sign.

Returns

Vector4

Sum of the vectors.

operator /(Vector4, Vector4)

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

public static Vector4 operator /(Vector4 value1, Vector4 value2)

Parameters

value1 Vector4

Source Vector4 on the left of the div sign.

value2 Vector4

Divisor Vector4 on the right of the div sign.

Returns

Vector4

The result of dividing the vectors.

operator /(Vector4, float)

Divides the components of a Vector4 by a scalar.

public static Vector4 operator /(Vector4 value1, float divider)

Parameters

value1 Vector4

Source Vector4 on the left of the div sign.

divider float

Divisor scalar on the right of the div sign.

Returns

Vector4

The result of dividing a vector by a scalar.

operator ==(Vector4, Vector4)

Compares whether two Vector4 instances are equal.

public static bool operator ==(Vector4 value1, Vector4 value2)

Parameters

value1 Vector4

Vector4 instance on the left of the equal sign.

value2 Vector4

Vector4 instance on the right of the equal sign.

Returns

bool

true if the instances are equal; false otherwise.

implicit operator Vector4(Vector4)

Converts a Vector4 to a Vector4.

public static implicit operator Vector4(Vector4 value)

Parameters

value Vector4

The converted value.

Returns

Vector4

operator !=(Vector4, Vector4)

Compares whether two Vector4 instances are not equal.

public static bool operator !=(Vector4 value1, Vector4 value2)

Parameters

value1 Vector4

Vector4 instance on the left of the not equal sign.

value2 Vector4

Vector4 instance on the right of the not equal sign.

Returns

bool

true if the instances are not equal; false otherwise.

operator *(Vector4, Vector4)

Multiplies the components of two vectors by each other.

public static Vector4 operator *(Vector4 value1, Vector4 value2)

Parameters

value1 Vector4

Source Vector4 on the left of the mul sign.

value2 Vector4

Source Vector4 on the right of the mul sign.

Returns

Vector4

Result of the vector multiplication.

operator *(Vector4, float)

Multiplies the components of vector by a scalar.

public static Vector4 operator *(Vector4 value, float scaleFactor)

Parameters

value Vector4

Source Vector4 on the left of the mul sign.

scaleFactor float

Scalar value on the right of the mul sign.

Returns

Vector4

Result of the vector multiplication with a scalar.

operator *(float, Vector4)

Multiplies the components of vector by a scalar.

public static Vector4 operator *(float scaleFactor, Vector4 value)

Parameters

scaleFactor float

Scalar value on the left of the mul sign.

value Vector4

Source Vector4 on the right of the mul sign.

Returns

Vector4

Result of the vector multiplication with a scalar.

operator -(Vector4, Vector4)

Subtracts a Vector4 from a Vector4.

public static Vector4 operator -(Vector4 value1, Vector4 value2)

Parameters

value1 Vector4

Source Vector4 on the left of the sub sign.

value2 Vector4

Source Vector4 on the right of the sub sign.

Returns

Vector4

Result of the vector subtraction.

operator -(Vector4)

Inverts values in the specified Vector4.

public static Vector4 operator -(Vector4 value)

Parameters

value Vector4

Source Vector4 on the right of the sub sign.

Returns

Vector4

Result of the inversion.