Nebula
Loading...
Searching...
No Matches
Mathf.Vector4 Struct Reference

Detailed Description

Describes a 4D-vector.

Inherits IEquatable< 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.
 
 Vector4 (Vector2 value, float z, float w)
 Constructs a 3d vector with X and Z from Vector2 and Z and W from the scalars.
 
 Vector4 (Vector3 value, float w)
 Constructs a 3d vector with X, Y, Z from Vector3 and W from a scalar.
 
 Vector4 (float value)
 Constructs a 4d vector with X, Y, Z and W set to the same value.
 
void Ceiling ()
 Round the members of this Vector4 towards positive infinity.
 
override bool Equals (object obj)
 Compares whether current instance is equal to specified Object.
 
bool Equals (Vector4 other)
 Compares whether current instance is equal to specified Vector4.
 
void Floor ()
 Round the members of this Vector4 towards negative infinity.
 
override int GetHashCode ()
 Gets the hash code of this Vector4.
 
float Length ()
 Returns the length of this Vector4.
 
float LengthSquared ()
 Returns the squared length of this Vector4.
 
void Normalize ()
 Turns this Vector4 to a unit vector with the same direction.
 
void Round ()
 Round the members of this Vector4 to the nearest integer value.
 
override string ToString ()
 Returns a String representation of this Vector4 in the format: {X:[X] Y:[Y] Z:[Z] W:[W]}.
 
void Deconstruct (out float x, out float y, out float z, out float w)
 Deconstruction method for Vector4.
 

Static Public Member Functions

static Vector4 Add (Vector4 value1, Vector4 value2)
 Performs vector addition on value1 and value2 .
 
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 .
 
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.
 
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.
 
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.
 
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.
 
static Vector4 Ceiling (Vector4 value)
 Creates a new Vector4 that contains members from another vector rounded towards positive infinity.
 
static void Ceiling (ref Vector4 value, out Vector4 result)
 Creates a new Vector4 that contains members from another vector rounded towards positive infinity.
 
static Vector4 Clamp (Vector4 value1, Vector4 min, Vector4 max)
 Clamps the specified value within a range.
 
static void Clamp (ref Vector4 value1, ref Vector4 min, ref Vector4 max, out Vector4 result)
 Clamps the specified value within a range.
 
static float Distance (Vector4 value1, Vector4 value2)
 Returns the distance between two vectors.
 
static void Distance (ref Vector4 value1, ref Vector4 value2, out float result)
 Returns the distance between two vectors.
 
static float DistanceSquared (Vector4 value1, Vector4 value2)
 Returns the squared distance between two vectors.
 
static void DistanceSquared (ref Vector4 value1, ref Vector4 value2, out float result)
 Returns the squared distance between two vectors.
 
static Vector4 Divide (Vector4 value1, Vector4 value2)
 Divides the components of a Vector4 by the components of another Vector4.
 
static Vector4 Divide (Vector4 value1, float divider)
 Divides the components of a Vector4 by a scalar.
 
static void Divide (ref Vector4 value1, float divider, out Vector4 result)
 Divides the components of a Vector4 by a scalar.
 
static void Divide (ref Vector4 value1, ref Vector4 value2, out Vector4 result)
 Divides the components of a Vector4 by the components of another Vector4.
 
static float Dot (Vector4 value1, Vector4 value2)
 Returns a dot product of two vectors.
 
static void Dot (ref Vector4 value1, ref Vector4 value2, out float result)
 Returns a dot product of two vectors.
 
static Vector4 Floor (Vector4 value)
 Creates a new Vector4 that contains members from another vector rounded towards negative infinity.
 
static void Floor (ref Vector4 value, out Vector4 result)
 Creates a new Vector4 that contains members from another vector rounded towards negative infinity.
 
static Vector4 Hermite (Vector4 value1, Vector4 tangent1, Vector4 value2, Vector4 tangent2, float amount)
 Creates a new Vector4 that contains hermite spline interpolation.
 
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.
 
static Vector4 Lerp (Vector4 value1, Vector4 value2, float amount)
 Creates a new Vector4 that contains linear interpolation of the specified vectors.
 
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.
 
static Vector4 LerpPrecise (Vector4 value1, Vector4 value2, float amount)
 Creates a new Vector4 that contains linear interpolation of the specified vectors.
 
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.
 
static Vector4 Max (Vector4 value1, Vector4 value2)
 Creates a new Vector4 that contains a maximal values from the two vectors.
 
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.
 
static Vector4 Min (Vector4 value1, Vector4 value2)
 Creates a new Vector4 that contains a minimal values from the two vectors.
 
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.
 
static Vector4 Multiply (Vector4 value1, Vector4 value2)
 Creates a new Vector4 that contains a multiplication of two vectors.
 
static Vector4 Multiply (Vector4 value1, float scaleFactor)
 Creates a new Vector4 that contains a multiplication of Vector4 and a scalar.
 
static void Multiply (ref Vector4 value1, float scaleFactor, out Vector4 result)
 Creates a new Vector4 that contains a multiplication of Vector4 and a scalar.
 
static void Multiply (ref Vector4 value1, ref Vector4 value2, out Vector4 result)
 Creates a new Vector4 that contains a multiplication of two vectors.
 
static Vector4 Negate (Vector4 value)
 Creates a new Vector4 that contains the specified vector inversion.
 
static void Negate (ref Vector4 value, out Vector4 result)
 Creates a new Vector4 that contains the specified vector inversion.
 
static Vector4 Normalize (Vector4 value)
 Creates a new Vector4 that contains a normalized values from another vector.
 
static void Normalize (ref Vector4 value, out Vector4 result)
 Creates a new Vector4 that contains a normalized values from another vector.
 
static Vector4 Round (Vector4 value)
 Creates a new Vector4 that contains members from another vector rounded to the nearest integer value.
 
static void Round (ref Vector4 value, out Vector4 result)
 Creates a new Vector4 that contains members from another vector rounded to the nearest integer value.
 
static Vector4 SmoothStep (Vector4 value1, Vector4 value2, float amount)
 Creates a new Vector4 that contains cubic interpolation of the specified vectors.
 
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.
 
static Vector4 Subtract (Vector4 value1, Vector4 value2)
 Creates a new Vector4 that contains subtraction of on Vector4 from a another.
 
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.
 
static Vector4 Transform (Vector2 value, Matrix matrix)
 Creates a new Vector4 that contains a transformation of 2d-vector by the specified Matrix.
 
static Vector4 Transform (Vector2 value, Quaternion rotation)
 Creates a new Vector4 that contains a transformation of 2d-vector by the specified Quaternion.
 
static Vector4 Transform (Vector3 value, Matrix matrix)
 Creates a new Vector4 that contains a transformation of 3d-vector by the specified Matrix.
 
static Vector4 Transform (Vector3 value, Quaternion rotation)
 Creates a new Vector4 that contains a transformation of 3d-vector by the specified Quaternion.
 
static Vector4 Transform (Vector4 value, Matrix matrix)
 Creates a new Vector4 that contains a transformation of 4d-vector by the specified Matrix.
 
static Vector4 Transform (Vector4 value, Quaternion rotation)
 Creates a new Vector4 that contains a transformation of 4d-vector by the specified Quaternion.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
static Vector4 operator- (Vector4 value)
 Inverts values in the specified Vector4.
 
static bool operator== (Vector4 value1, Vector4 value2)
 Compares whether two Vector4 instances are equal.
 
static bool operator!= (Vector4 value1, Vector4 value2)
 Compares whether two Vector4 instances are not equal.
 
static Vector4 operator+ (Vector4 value1, Vector4 value2)
 Adds two vectors.
 
static Vector4 operator- (Vector4 value1, Vector4 value2)
 Subtracts a Vector4 from a Vector4.
 
static Vector4 operator* (Vector4 value1, Vector4 value2)
 Multiplies the components of two vectors by each other.
 
static Vector4 operator* (Vector4 value, float scaleFactor)
 Multiplies the components of vector by a scalar.
 
static Vector4 operator* (float scaleFactor, Vector4 value)
 Multiplies the components of vector by a scalar.
 
static Vector4 operator/ (Vector4 value1, Vector4 value2)
 Divides the components of a Vector4 by the components of another Vector4.
 
static Vector4 operator/ (Vector4 value1, float divider)
 Divides the components of a Vector4 by a scalar.
 

Public Attributes

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

Properties

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

Static Private Attributes

static readonly Vector4 zero = new Vector4()
 
static readonly Vector4 one = new Vector4(1f, 1f, 1f, 1f)
 
static readonly Vector4 unitX = new Vector4(1f, 0f, 0f, 0f)
 
static readonly Vector4 unitY = new Vector4(0f, 1f, 0f, 0f)
 
static readonly Vector4 unitZ = new Vector4(0f, 0f, 1f, 0f)
 
static readonly Vector4 unitW = new Vector4(0f, 0f, 0f, 1f)
 

Constructor & Destructor Documentation

◆ Vector4() [1/4]

Mathf.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.

◆ Vector4() [2/4]

Mathf.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.

◆ Vector4() [3/4]

Mathf.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.

◆ Vector4() [4/4]

Mathf.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.

Member Function Documentation

◆ Add() [1/2]

static void Mathf.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.

◆ Add() [2/2]

static Vector4 Mathf.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.

◆ Barycentric() [1/2]

static void Mathf.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.

◆ Barycentric() [2/2]

static Vector4 Mathf.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.

◆ CatmullRom() [1/2]

static void Mathf.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.

◆ CatmullRom() [2/2]

static Vector4 Mathf.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.

◆ Ceiling() [1/3]

void Mathf.Vector4.Ceiling ( )
inline

Round the members of this Vector4 towards positive infinity.

◆ Ceiling() [2/3]

static void Mathf.Vector4.Ceiling ( ref Vector4 value,
out Vector4 result )
inlinestatic

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

Parameters
valueSource Vector4.
resultThe rounded Vector4.

◆ Ceiling() [3/3]

static Vector4 Mathf.Vector4.Ceiling ( Vector4 value)
inlinestatic

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

Parameters
valueSource Vector4.
Returns
The rounded Vector4.

◆ Clamp() [1/2]

static void Mathf.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.

◆ Clamp() [2/2]

static Vector4 Mathf.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.

◆ Deconstruct()

void Mathf.Vector4.Deconstruct ( out float x,
out float y,
out float z,
out float w )
inline

Deconstruction method for Vector4.

Parameters
x
y
z
w

◆ Distance() [1/2]

static void Mathf.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.

◆ Distance() [2/2]

static float Mathf.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.

◆ DistanceSquared() [1/2]

static void Mathf.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.

◆ DistanceSquared() [2/2]

static float Mathf.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.

◆ Divide() [1/4]

static void Mathf.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.

◆ Divide() [2/4]

static void Mathf.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.

◆ Divide() [3/4]

static Vector4 Mathf.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.

◆ Divide() [4/4]

static Vector4 Mathf.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.

◆ Dot() [1/2]

static void Mathf.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.

◆ Dot() [2/2]

static float Mathf.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.

◆ Equals() [1/2]

override bool Mathf.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.

◆ Equals() [2/2]

bool Mathf.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.

◆ Floor() [1/3]

void Mathf.Vector4.Floor ( )
inline

Round the members of this Vector4 towards negative infinity.

◆ Floor() [2/3]

static void Mathf.Vector4.Floor ( ref Vector4 value,
out Vector4 result )
inlinestatic

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

Parameters
valueSource Vector4.
resultThe rounded Vector4.

◆ Floor() [3/3]

static Vector4 Mathf.Vector4.Floor ( Vector4 value)
inlinestatic

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

Parameters
valueSource Vector4.
Returns
The rounded Vector4.

◆ GetHashCode()

override int Mathf.Vector4.GetHashCode ( )
inline

Gets the hash code of this Vector4.

Returns
Hash code of this Vector4.

◆ Hermite() [1/2]

static void Mathf.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.

◆ Hermite() [2/2]

static Vector4 Mathf.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.

◆ Length()

float Mathf.Vector4.Length ( )
inline

Returns the length of this Vector4.

Returns
The length of this Vector4.

◆ LengthSquared()

float Mathf.Vector4.LengthSquared ( )
inline

Returns the squared length of this Vector4.

Returns
The squared length of this Vector4.

◆ Lerp() [1/2]

static void Mathf.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.

◆ Lerp() [2/2]

static Vector4 Mathf.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.

◆ LerpPrecise() [1/2]

static void Mathf.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.

◆ LerpPrecise() [2/2]

static Vector4 Mathf.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.

◆ Max() [1/2]

static void Mathf.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.

◆ Max() [2/2]

static Vector4 Mathf.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.

◆ Min() [1/2]

static void Mathf.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.

◆ Min() [2/2]

static Vector4 Mathf.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.

◆ Multiply() [1/4]

static void Mathf.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.

◆ Multiply() [2/4]

static void Mathf.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.

◆ Multiply() [3/4]

static Vector4 Mathf.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.

◆ Multiply() [4/4]

static Vector4 Mathf.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.

◆ Negate() [1/2]

static void Mathf.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.

◆ Negate() [2/2]

static Vector4 Mathf.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.

◆ Normalize() [1/3]

void Mathf.Vector4.Normalize ( )
inline

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

◆ Normalize() [2/3]

static void Mathf.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.

◆ Normalize() [3/3]

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

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

Parameters
valueSource Vector4.
Returns
Unit vector.

◆ operator!=()

static bool Mathf.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.


◆ operator*() [1/3]

static Vector4 Mathf.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.

◆ operator*() [2/3]

static Vector4 Mathf.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.

◆ operator*() [3/3]

static Vector4 Mathf.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.

◆ operator+()

static Vector4 Mathf.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.

◆ operator-() [1/2]

static Vector4 Mathf.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.

◆ operator-() [2/2]

static Vector4 Mathf.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.

◆ operator/() [1/2]

static Vector4 Mathf.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.

◆ operator/() [2/2]

static Vector4 Mathf.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.

◆ operator==()

static bool Mathf.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.

◆ Round() [1/3]

void Mathf.Vector4.Round ( )
inline

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

◆ Round() [2/3]

static void Mathf.Vector4.Round ( ref Vector4 value,
out Vector4 result )
inlinestatic

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

Parameters
valueSource Vector4.
resultThe rounded Vector4.

◆ Round() [3/3]

static Vector4 Mathf.Vector4.Round ( Vector4 value)
inlinestatic

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

Parameters
valueSource Vector4.
Returns
The rounded Vector4.

◆ SmoothStep() [1/2]

static void Mathf.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.

◆ SmoothStep() [2/2]

static Vector4 Mathf.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.

◆ Subtract() [1/2]

static void Mathf.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.

◆ Subtract() [2/2]

static Vector4 Mathf.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.

◆ ToString()

override string Mathf.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.

◆ Transform() [1/16]

static void Mathf.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.

◆ Transform() [2/16]

static void Mathf.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.

◆ Transform() [3/16]

static void Mathf.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.

◆ Transform() [4/16]

static void Mathf.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.

◆ Transform() [5/16]

static void Mathf.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.

◆ Transform() [6/16]

static void Mathf.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.

◆ Transform() [7/16]

static Vector4 Mathf.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.

◆ Transform() [8/16]

static Vector4 Mathf.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.

◆ Transform() [9/16]

static Vector4 Mathf.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.

◆ Transform() [10/16]

static Vector4 Mathf.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.

◆ Transform() [11/16]

static Vector4 Mathf.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.

◆ Transform() [12/16]

static Vector4 Mathf.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.

◆ Transform() [13/16]

static void Mathf.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.

◆ Transform() [14/16]

static void Mathf.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.

◆ Transform() [15/16]

static void Mathf.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.

◆ Transform() [16/16]

static void Mathf.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.

Member Data Documentation

◆ one

readonly Vector4 Mathf.Vector4.one = new Vector4(1f, 1f, 1f, 1f)
staticprivate

◆ unitW

readonly Vector4 Mathf.Vector4.unitW = new Vector4(0f, 0f, 0f, 1f)
staticprivate

◆ unitX

readonly Vector4 Mathf.Vector4.unitX = new Vector4(1f, 0f, 0f, 0f)
staticprivate

◆ unitY

readonly Vector4 Mathf.Vector4.unitY = new Vector4(0f, 1f, 0f, 0f)
staticprivate

◆ unitZ

readonly Vector4 Mathf.Vector4.unitZ = new Vector4(0f, 0f, 1f, 0f)
staticprivate

◆ W

float Mathf.Vector4.W

The w coordinate of this Vector4.

◆ X

float Mathf.Vector4.X

The x coordinate of this Vector4.

◆ Y

float Mathf.Vector4.Y

The y coordinate of this Vector4.

◆ Z

float Mathf.Vector4.Z

The z coordinate of this Vector4.

◆ zero

readonly Vector4 Mathf.Vector4.zero = new Vector4()
staticprivate

Property Documentation

◆ DebugDisplayString

string Mathf.Vector4.DebugDisplayString
getpackage

◆ One

Vector4 Mathf.Vector4.One
staticget

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

◆ UnitW

Vector4 Mathf.Vector4.UnitW
staticget

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

◆ UnitX

Vector4 Mathf.Vector4.UnitX
staticget

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

◆ UnitY

Vector4 Mathf.Vector4.UnitY
staticget

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

◆ UnitZ

Vector4 Mathf.Vector4.UnitZ
staticget

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

◆ Zero

Vector4 Mathf.Vector4.Zero
staticget

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


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