Vector4 Structure
Microsoft Silverlight will reach end of support after October 2021. Learn more.
Defines a vector with four components.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Math (in Microsoft.Xna.Framework.Math.dll)
Syntax
'Declaration
Public Structure Vector4
public struct Vector4
The Vector4 type exposes the following members.
Constructors
Name | Description | |
---|---|---|
Vector4(Single) | Creates a new instance of Vector4. | |
Vector4(Vector3, Single) | Initializes a new instance of Vector4. | |
Vector4(Vector2, Single, Single) | Initializes a new instance of Vector4. | |
Vector4(Single, Single, Single, Single) | Initializes a new instance of Vector4. |
Top
Properties
Name | Description | |
---|---|---|
One | Returns a Vector4 with all of its components set to one. | |
UnitW | Returns the Vector4 (0, 0, 0, 1). | |
UnitX | Returns the Vector4 (1, 0, 0, 0). | |
UnitY | Returns the Vector4 (0, 1, 0, 0). | |
UnitZ | Returns the Vector4 (0, 0, 1, 0). | |
Zero | Returns a Vector4 with all of its components set to zero. |
Top
Methods
Name | Description | |
---|---|---|
Add(Vector4, Vector4) | Adds two vectors. | |
Add(Vector4%, Vector4%, Vector4%) | Adds two vectors. | |
Barycentric(Vector4, Vector4, Vector4, Single, Single) | Returns a Vector4 containing the 4D Cartesian coordinates of a point specified in barycentric (areal) coordinates relative to a 4D triangle. | |
Barycentric(Vector4%, Vector4%, Vector4%, Single, Single, Vector4%) | Returns a Vector4 containing the 4D Cartesian coordinates of a point specified in barycentric (areal) coordinates relative to a 4D triangle. | |
CatmullRom(Vector4, Vector4, Vector4, Vector4, Single) | Performs a Catmull-Rom interpolation using the specified positions. | |
CatmullRom(Vector4%, Vector4%, Vector4%, Vector4%, Single, Vector4%) | Performs a Catmull-Rom interpolation using the specified positions. | |
Clamp(Vector4, Vector4, Vector4) | Restricts a value to be within a specified range. | |
Clamp(Vector4%, Vector4%, Vector4%, Vector4%) | Restricts a value to be within a specified range. | |
Distance(Vector4, Vector4) | Calculates the distance between two vectors. | |
Distance(Vector4%, Vector4%, Single%) | Calculates the distance between two vectors. | |
DistanceSquared(Vector4, Vector4) | Calculates the distance between two vectors squared. | |
DistanceSquared(Vector4%, Vector4%, Single%) | Calculates the distance between two vectors squared. | |
Divide(Vector4, Vector4) | Divides the components of a vector by the components of another vector. | |
Divide(Vector4, Single) | Divides a vector by a scalar value. | |
Divide(Vector4%, Vector4%, Vector4%) | Divides the components of a vector by the components of another vector. | |
Divide(Vector4%, Single, Vector4%) | Divides a vector by a scalar value. | |
Dot(Vector4, Vector4) | Calculates the dot product of two vectors. | |
Dot(Vector4%, Vector4%, Single%) | Calculates the dot product of two vectors. | |
Equals(Object) | Returns a value that indicates whether the current instance is equal to a specified object. (Overrides ValueType.Equals(Object).) | |
Equals(Vector4) | Determines whether the specified Object is equal to the Vector4. | |
GetHashCode | Gets the hash code of this object. (Overrides ValueType.GetHashCode().) | |
Hermite(Vector4, Vector4, Vector4, Vector4, Single) | Performs a Hermite spline interpolation. | |
Hermite(Vector4%, Vector4%, Vector4%, Vector4%, Single, Vector4%) | Performs a Hermite spline interpolation. | |
Length | Calculates the length of the vector. | |
LengthSquared | Calculates the length of the vector squared. | |
Lerp(Vector4, Vector4, Single) | Performs a linear interpolation between two vectors. | |
Lerp(Vector4%, Vector4%, Single, Vector4%) | Performs a linear interpolation between two vectors. | |
Max(Vector4, Vector4) | Returns a vector that contains the highest value from each matching pair of components. | |
Max(Vector4%, Vector4%, Vector4%) | Returns a vector that contains the highest value from each matching pair of components. | |
Min(Vector4, Vector4) | Returns a vector that contains the lowest value from each matching pair of components. | |
Min(Vector4%, Vector4%, Vector4%) | Returns a vector that contains the lowest value from each matching pair of components. | |
Multiply(Vector4, Vector4) | Multiplies the components of two vectors by each other. | |
Multiply(Vector4, Single) | Multiplies a vector by a scalar. | |
Multiply(Vector4%, Vector4%, Vector4%) | Multiplies the components of two vectors by each other. | |
Multiply(Vector4%, Single, Vector4%) | Multiplies a vector by a scalar value. | |
Negate(Vector4) | Returns a vector pointing in the opposite direction. | |
Negate(Vector4%, Vector4%) | Returns a vector pointing in the opposite direction. | |
Normalize() | Turns the current vector into a unit vector. | |
Normalize(Vector4) | Creates a unit vector from the specified vector. | |
Normalize(Vector4%, Vector4%) | Returns a normalized version of the specified vector. | |
SmoothStep(Vector4, Vector4, Single) | Interpolates between two values using a cubic equation. | |
SmoothStep(Vector4%, Vector4%, Single, Vector4%) | Interpolates between two values using a cubic equation. | |
Subtract(Vector4, Vector4) | Subtracts a vector from a vector. | |
Subtract(Vector4%, Vector4%, Vector4%) | Subtracts a vector from a vector. | |
ToString | Retrieves a string representation of the current object. (Overrides ValueType.ToString().) | |
Transform(Vector2, Matrix) | Transforms a Vector2 by the given Matrix. | |
Transform(Vector2, Quaternion) | Transforms a Vector2 by a specified Quaternion into a Vector4. | |
Transform(Vector3, Matrix) | Transforms a Vector3 by the given Matrix. | |
Transform(Vector3, Quaternion) | Transforms a Vector3 by a specified Quaternion into a Vector4. | |
Transform(Vector4, Matrix) | Transforms a Vector4 by the specified Matrix. | |
Transform(Vector4, Quaternion) | Transforms a Vector4 by a specified Quaternion. | |
Transform(Vector2%, Matrix%, Vector4%) | Transforms a Vector2 by the given Matrix. | |
Transform(Vector2%, Quaternion%, Vector4%) | Transforms a Vector2 by a specified Quaternion into a Vector4. | |
Transform(Vector3%, Matrix%, Vector4%) | Transforms a Vector3 by the given Matrix. | |
Transform(Vector3%, Quaternion%, Vector4%) | Transforms a Vector3 by a specified Quaternion into a Vector4. | |
Transform(Vector4%, Matrix%, Vector4%) | Transforms a Vector4 by the given Matrix. | |
Transform(Vector4%, Quaternion%, Vector4%) | Transforms a Vector4 by a specified Quaternion. | |
Transform(array<Vector4[], Matrix%, array<Vector4[]) | Transforms an array of Vector4s by a specified Matrix. | |
Transform(array<Vector4[], Quaternion%, array<Vector4[]) | Transforms an array of Vector4s by a specified Quaternion. | |
Transform(array<Vector4[], Int32, Matrix%, array<Vector4[], Int32, Int32) | Transforms a specified range in an array of Vector4s by a specified Matrix into a specified range in a destination array. | |
Transform(array<Vector4[], Int32, Quaternion%, array<Vector4[], Int32, Int32) | Transforms a specified range in an array of Vector4s by a specified Quaternion into a specified range in a destination array. |
Top
Operators
Name | Description | |
---|---|---|
Addition | Adds two vectors. | |
Division(Vector4, Vector4) | Divides the components of a vector by the components of another vector. | |
Division(Vector4, Single) | Divides a vector by a scalar value. | |
Equality | Tests vectors for equality. | |
Inequality | Tests vectors for inequality. | |
Multiply(Single, Vector4) | Multiplies a vector by a scalar. | |
Multiply(Vector4, Vector4) | Multiplies the components of two vectors by each other. | |
Multiply(Vector4, Single) | Multiplies a vector by a scalar. | |
Subtraction | Subtracts a vector from a vector. | |
UnaryNegation | Returns a vector pointing in the opposite direction. |
Top
Fields
Name | Description | |
---|---|---|
W | Gets or sets the w-component of the vector. | |
X | Gets or sets the x-component of the vector. | |
Y | Gets or sets the y-component of the vector. | |
Z | Gets or sets the z-component of the vector. |
Top
Version Information
Silverlight
Supported in: 5
Platforms
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.