Vector3 Members

The following tables list the members exposed by the Vector3 type.

Public Constructors

Name Description
Public Method Vector3 Overloaded. Initializes a new instance of Vector3.

Public Fields

Name Description
Public Field X Gets or sets the x-component of the vector.
Public Field Y Gets or sets the y-component of the vector.
Public Field Z Gets or sets the z-component of the vector.

Public Properties

Name Description
Public Property Static Backward Returns a unit Vector3 designating backward in a right-handed coordinate system (0, 0, 1).
Public Property Static Down Returns a unit Vector3 designating down (0, −1, 0).
Public Property Static Forward Returns a unit Vector3 designating forward in a right-handed coordinate system(0, 0, −1).
Public Property Static Left Returns a unit Vector3 designating left (−1, 0, 0).
Public Property Static One Returns a Vector3 with ones in all of its components.
Public Property Static Right Returns a unit Vector3 pointing to the right (1, 0, 0).
Public Property Static UnitX Returns the x unit Vector3 (1, 0, 0).
Public Property Static UnitY Returns the y unit Vector3 (0, 1, 0).
Public Property Static UnitZ Returns the z unit Vector3 (0, 0, 1).
Public Property Static Up Returns a unit vector designating up (0, 1, 0).
Public Property Static Zero Returns a Vector3 with all of its components set to zero.

Public Methods

Name Description
Public Method Static Add Overloaded. Adds two vectors.
Public Method Static Barycentric Overloaded. Returns a Vector3 containing the 3D Cartesian coordinates of a point specified in Barycentric coordinates relative to a 3D triangle.
Public Method Static CatmullRom Overloaded. Performs a Catmull-Rom interpolation using the specified positions.
Public Method Static Clamp Overloaded. Restricts a value to be within a specified range.
Public Method Static Cross Overloaded. Calculates the cross product of two vectors.
Public Method Static Distance Overloaded. Calculates the distance between two vectors.
Public Method Static DistanceSquared Overloaded. Calculates the distance between two vectors squared.
Public Method Static Divide Overloaded. Divide a vector by a scalar or another vector.
Public Method Static Dot Overloaded. Calculates the dot product of two vectors. If the two vectors are unit vectors, the dot product returns a floating point value between -1 and 1 that can be used to determine some properties of the angle between two vectors. For example, it can show whether the vectors are orthogonal, parallel, or have an acute or obtuse angle between them.
Public Method Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
Public Method GetHashCode Gets the hash code of the vector object.
Public Method GetType (Inherited from Object.)
Public Method Static Hermite Overloaded. Performs a Hermite spline interpolation.
Public Method Length Calculates the length of the vector.
Public Method LengthSquared Calculates the length of the vector squared.
Public Method Static Lerp Overloaded. Performs a linear interpolation between two vectors.
Public Method Static Max Overloaded. Returns a vector that contains the highest value from each matching pair of components.
Public Method Static Min Overloaded. Returns a vector that contains the lowest value from each matching pair of components.
Public Method Static Multiply Overloaded. Multiplies a vector by a scalar or another vector.
Public Method Static Negate Overloaded. Returns a vector pointing in the opposite direction.
Public Method Normalize Overloaded. Creates a unit vector from the specified vector. The result is a vector one unit in length pointing in the same direction as the original vector.
Public Method Static op_Addition Adds two vectors.
Public Method Static op_Division Overloaded. Divides a vector by a scalar or another vector.
Public Method Static op_Equality Tests vectors for equality.
Public Method Static op_Inequality Tests vectors for inequality.
Public Method Static op_Multiply Overloaded. Multiplies a vector by a scalar or another vector.
Public Method Static op_Subtraction Subtracts a vector from a vector.
Public Method Static op_UnaryNegation Returns a vector pointing in the opposite direction.
Public Method Static Reflect Overloaded. Returns the reflection of a vector off a surface that has the specified normal.
Public Method Static SmoothStep Overloaded. Interpolates between two values using a cubic equation.
Public Method Static Subtract Overloaded. Subtracts a vector from a vector.
Public Method ToString Retrieves a string representation of the current object.
Public Method Static Transform Overloaded. Transforms a Vector3 or array of Vector3s by a specified Matrix or Quaternion.
Public Method Static TransformNormal Overloaded. Transforms a vector normal by a matrix.

Protected Methods

Name Description
Protected Method Finalize (Inherited from Object.)
Protected Method MemberwiseClone (Inherited from Object.)

See Also

Reference

Vector3 Structure
Microsoft.Xna.Framework Namespace