Vector4 Structure

Defines a vector with four components.

Namespace:  Microsoft.Xna.Framework
Assembly:  Microsoft.Xna.Framework.Math (in Microsoft.Xna.Framework.Math.dll)

public struct Vector4

The Vector4 type exposes the following members.

  NameDescription
Public methodVector4(Single)Creates a new instance of Vector4.
Public methodVector4(Vector3, Single)Initializes a new instance of Vector4.
Public methodVector4(Vector2, Single, Single)Initializes a new instance of Vector4.
Public methodVector4(Single, Single, Single, Single)Initializes a new instance of Vector4.
Top

  NameDescription
Public propertyStatic memberOneReturns a Vector4 with all of its components set to one.
Public propertyStatic memberUnitWReturns the Vector4 (0, 0, 0, 1).
Public propertyStatic memberUnitXReturns the Vector4 (1, 0, 0, 0).
Public propertyStatic memberUnitYReturns the Vector4 (0, 1, 0, 0).
Public propertyStatic memberUnitZReturns the Vector4 (0, 0, 1, 0).
Public propertyStatic memberZeroReturns a Vector4 with all of its components set to zero.
Top

  NameDescription
Public methodStatic memberAdd(Vector4, Vector4)Adds two vectors.
Public methodStatic memberAdd(Vector4, Vector4, Vector4)Adds two vectors.
Public methodStatic memberBarycentric(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.
Public methodStatic memberBarycentric(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.
Public methodStatic memberCatmullRom(Vector4, Vector4, Vector4, Vector4, Single)Performs a Catmull-Rom interpolation using the specified positions.
Public methodStatic memberCatmullRom(Vector4, Vector4, Vector4, Vector4, Single, Vector4)Performs a Catmull-Rom interpolation using the specified positions.
Public methodStatic memberClamp(Vector4, Vector4, Vector4)Restricts a value to be within a specified range.
Public methodStatic memberClamp(Vector4, Vector4, Vector4, Vector4)Restricts a value to be within a specified range.
Public methodStatic memberDistance(Vector4, Vector4)Calculates the distance between two vectors.
Public methodStatic memberDistance(Vector4, Vector4, Single)Calculates the distance between two vectors.
Public methodStatic memberDistanceSquared(Vector4, Vector4)Calculates the distance between two vectors squared.
Public methodStatic memberDistanceSquared(Vector4, Vector4, Single)Calculates the distance between two vectors squared.
Public methodStatic memberDivide(Vector4, Vector4)Divides the components of a vector by the components of another vector.
Public methodStatic memberDivide(Vector4, Single)Divides a vector by a scalar value.
Public methodStatic memberDivide(Vector4, Vector4, Vector4)Divides the components of a vector by the components of another vector.
Public methodStatic memberDivide(Vector4, Single, Vector4)Divides a vector by a scalar value.
Public methodStatic memberDot(Vector4, Vector4)Calculates the dot product of two vectors.
Public methodStatic memberDot(Vector4, Vector4, Single)Calculates the dot product of two vectors.
Public methodEquals(Object)Returns a value that indicates whether the current instance is equal to a specified object. (Overrides ValueType.Equals(Object).)
Public methodEquals(Vector4)Determines whether the specified Object is equal to the Vector4.
Public methodGetHashCodeGets the hash code of this object. (Overrides ValueType.GetHashCode().)
Public methodStatic memberHermite(Vector4, Vector4, Vector4, Vector4, Single)Performs a Hermite spline interpolation.
Public methodStatic memberHermite(Vector4, Vector4, Vector4, Vector4, Single, Vector4)Performs a Hermite spline interpolation.
Public methodLengthCalculates the length of the vector.
Public methodLengthSquaredCalculates the length of the vector squared.
Public methodStatic memberLerp(Vector4, Vector4, Single)Performs a linear interpolation between two vectors.
Public methodStatic memberLerp(Vector4, Vector4, Single, Vector4)Performs a linear interpolation between two vectors.
Public methodStatic memberMax(Vector4, Vector4)Returns a vector that contains the highest value from each matching pair of components.
Public methodStatic memberMax(Vector4, Vector4, Vector4)Returns a vector that contains the highest value from each matching pair of components.
Public methodStatic memberMin(Vector4, Vector4)Returns a vector that contains the lowest value from each matching pair of components.
Public methodStatic memberMin(Vector4, Vector4, Vector4)Returns a vector that contains the lowest value from each matching pair of components.
Public methodStatic memberMultiply(Vector4, Vector4)Multiplies the components of two vectors by each other.
Public methodStatic memberMultiply(Vector4, Single)Multiplies a vector by a scalar.
Public methodStatic memberMultiply(Vector4, Vector4, Vector4)Multiplies the components of two vectors by each other.
Public methodStatic memberMultiply(Vector4, Single, Vector4)Multiplies a vector by a scalar value.
Public methodStatic memberNegate(Vector4)Returns a vector pointing in the opposite direction.
Public methodStatic memberNegate(Vector4, Vector4)Returns a vector pointing in the opposite direction.
Public methodNormalize()Turns the current vector into a unit vector.
Public methodStatic memberNormalize(Vector4)Creates a unit vector from the specified vector.
Public methodStatic memberNormalize(Vector4, Vector4)Returns a normalized version of the specified vector.
Public methodStatic memberSmoothStep(Vector4, Vector4, Single)Interpolates between two values using a cubic equation.
Public methodStatic memberSmoothStep(Vector4, Vector4, Single, Vector4)Interpolates between two values using a cubic equation.
Public methodStatic memberSubtract(Vector4, Vector4)Subtracts a vector from a vector.
Public methodStatic memberSubtract(Vector4, Vector4, Vector4)Subtracts a vector from a vector.
Public methodToStringRetrieves a string representation of the current object. (Overrides ValueType.ToString().)
Public methodStatic memberTransform(Vector2, Matrix)Transforms a Vector2 by the given Matrix.
Public methodStatic memberTransform(Vector2, Quaternion)Transforms a Vector2 by a specified Quaternion into a Vector4.
Public methodStatic memberTransform(Vector3, Matrix)Transforms a Vector3 by the given Matrix.
Public methodStatic memberTransform(Vector3, Quaternion)Transforms a Vector3 by a specified Quaternion into a Vector4.
Public methodStatic memberTransform(Vector4, Matrix)Transforms a Vector4 by the specified Matrix.
Public methodStatic memberTransform(Vector4, Quaternion)Transforms a Vector4 by a specified Quaternion.
Public methodStatic memberTransform(Vector2, Matrix, Vector4)Transforms a Vector2 by the given Matrix.
Public methodStatic memberTransform(Vector2, Quaternion, Vector4)Transforms a Vector2 by a specified Quaternion into a Vector4.
Public methodStatic memberTransform(Vector3, Matrix, Vector4)Transforms a Vector3 by the given Matrix.
Public methodStatic memberTransform(Vector3, Quaternion, Vector4)Transforms a Vector3 by a specified Quaternion into a Vector4.
Public methodStatic memberTransform(Vector4, Matrix, Vector4)Transforms a Vector4 by the given Matrix.
Public methodStatic memberTransform(Vector4, Quaternion, Vector4)Transforms a Vector4 by a specified Quaternion.
Public methodStatic memberTransform(Vector4[], Matrix, Vector4[])Transforms an array of Vector4s by a specified Matrix.
Public methodStatic memberTransform(Vector4[], Quaternion, Vector4[])Transforms an array of Vector4s by a specified Quaternion.
Public methodStatic memberTransform(Vector4[], Int32, Matrix, Vector4[], Int32, Int32)Transforms a specified range in an array of Vector4s by a specified Matrix into a specified range in a destination array.
Public methodStatic memberTransform(Vector4[], Int32, Quaternion, 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

  NameDescription
Public operatorStatic memberAdditionAdds two vectors.
Public operatorStatic memberDivision(Vector4, Vector4)Divides the components of a vector by the components of another vector.
Public operatorStatic memberDivision(Vector4, Single)Divides a vector by a scalar value.
Public operatorStatic memberEqualityTests vectors for equality.
Public operatorStatic memberInequalityTests vectors for inequality.
Public operatorStatic memberMultiply(Single, Vector4)Multiplies a vector by a scalar.
Public operatorStatic memberMultiply(Vector4, Vector4)Multiplies the components of two vectors by each other.
Public operatorStatic memberMultiply(Vector4, Single)Multiplies a vector by a scalar.
Public operatorStatic memberSubtractionSubtracts a vector from a vector.
Public operatorStatic memberUnaryNegationReturns a vector pointing in the opposite direction.
Top

  NameDescription
Public fieldWGets or sets the w-component of the vector.
Public fieldXGets or sets the x-component of the vector.
Public fieldYGets or sets the y-component of the vector.
Public fieldZGets or sets the z-component of the vector.
Top

Silverlight

Supported in: 5

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Community Additions

ADD
Show: