Expand description
§DirectX Math for Rust
A rust translation of DirectXMath, a SIMD linear algebra library for use in games and graphics apps.
Most functions and structs are exported at the crate root. Modules are organized according to the DirectXMath reference documentation. Additional DirectXMath documentation may be found in the previous version reference.
§Matrix multiplication order and memory layout
DirectXMath uses “row-major” matrices, row-vectors, and pre-multiplication. Handedness is determined by
which function version is used (RH
vs. LH
). Multiplication order is the same as transformation order.
Row-major multiplication order:
MVP = Model * View * Projection;
Column-major multiplication order:
MVP = Projection * View * Model;
When laid out in memory, the data elements 0
through 15
of a “row-major” matrix with “row-vectors”
are in the same order as an OpenGL “column-major” matrix with “column-vectors”. The translation
components of a transformation matrix occupy elements 12
, 13
, and 14
.
For example, XMMatrixTranslation
(12.0, 13.0, 14.0)
results in the following contiguous
memory (e.g. [f32; 16]
):
[1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 12.0, 13.0, 14.0, 1.0]
§Example
use directx_math::*;
let eye = XMVectorSet(10.0, 10.0, 10.0, 0.0);
let focus = XMVectorSet(0.0, 0.0, 0.0, 0.0);
let up = XMVectorSet(0.0, 1.0, 0.0, 0.0);
let view = XMMatrixLookAtRH(eye, focus, up);
let fov_y = XMConvertToRadians(65.0);
let aspect_ratio = 1024.0 / 768.0;
let near_z = 0.1;
let far_z = 1000.0;
let projection = XMMatrixPerspectiveFovRH(fov_y, aspect_ratio, near_z, far_z);
let model = XMMatrixIdentity();
let mvp = XMMatrixMultiply(XMMatrixMultiply(model, &view), &projection);
// or use the unit struct with operator overloads
let model = XMMatrix(model);
let view = XMMatrix(view);
let projection = XMMatrix(projection);
// row-major multiplication order is the same as the transformation order
assert_eq!(XMMatrix(mvp), model * view * projection);
Modules§
- accessor
- Vector accessors
- collision
- Collision functions and bounding volumes
- conversion
- Vector data conversion functions
- load
- Vector and Matrix load functions
- matrix
- Matrix functions
- plane
- Plane functions
- quaternion
- Quaternion functions
- scalar
- Scalar functions
- store
- Vector and Matrix store functions
- template
- Vector manipulation functions
- utility
- Utility and comparison functions
- vector
- Vector functions usable on any vector type
- vector2d
- 2D Vector functions
- vector3d
- 3D Vector functions
- vector4d
- 4D Vector functions
Structs§
- Align16
- XMFLOA
T2 - XMFLOA
T3 - XMFLOA
T4 - XMFLOA
T3X3 - XMFLOA
T3X4 - XMFLOA
T4X3 - XMFLOA
T4X4 - XMINT2
- XMINT3
- XMINT4
- XMMatrix
- Unit struct for
XMMATRIX
operator overloads. - XMUINT2
- XMUINT3
- XMUINT4
- XMVector
- Unit struct for
XMVECTOR
operator overloads.
Enums§
- Permute0W
- Permute0X
- Permute0Y
- Permute0Z
- Permute1W
- Permute1X
- Permute1Y
- Permute1Z
- SwizzleW
- SwizzleX
- SwizzleY
- SwizzleZ
Constants§
- XM_
1DIV2PI - XM_
1DIVPI - XM_2PI
- XM_
CACHE_ LINE_ SIZE - XM_
CRMASK_ CR6 - XM_
CRMASK_ CR6BOUNDS - XM_
CRMASK_ CR6FALSE - XM_
CRMASK_ CR6TRUE - XM_
PERMUTE_ 0W - XM_
PERMUTE_ 0X - XM_
PERMUTE_ 0Y - XM_
PERMUTE_ 0Z - XM_
PERMUTE_ 1W - XM_
PERMUTE_ 1X - XM_
PERMUTE_ 1Y - XM_
PERMUTE_ 1Z - XM_PI
- XM_
PIDI V2 - XM_
PIDI V4 - XM_
SELECT_ 0 - XM_
SELECT_ 1 - XM_
SWIZZLE_ W - XM_
SWIZZLE_ X - XM_
SWIZZLE_ Y - XM_
SWIZZLE_ Z
Traits§
- Permute
- XMVectorPermute trait parameters
- Swizzle
- XMVectorSwizzle trait parameters
- XMVector
Permute - Permutes the components of two vectors to create a new vector.
- XMVector
Swizzle - Swizzles a vector
Functions§
- XMComparison
AllFalse - Tests the comparison value to determine if all of the compared components are false.
- XMComparison
AllIn Bounds - Tests the comparison value to determine if all of the compared components are within set bounds.
- XMComparison
AllTrue - Tests the comparison value to determine if all of the compared components are true.
- XMComparison
AnyFalse - Tests the comparison value to determine if any of the compared components are false.
- XMComparison
AnyOut OfBounds - Tests the comparison value to determine if any of the compared components are outside the set bounds.
- XMComparison
AnyTrue - Tests the comparison value to determine if any of the compared components are true.
- XMComparison
Mixed - Tests the comparison value to determine if the compared components had mixed results–some true and some false.
- XMConvert
Float ToHalf - Converts a single-precision floating-point value to a half-precision floating-point value.
- XMConvert
Half ToFloat - Converts a half-precision floating-point value to a single-precision floating-point value.
- XMConvert
ToDegrees - Converts an angle measured in radians into one measured in degrees.
- XMConvert
ToRadians - Converts an angle measured in degrees into one measured in radians.
- XMConvert
Vector Float ToInt - Converts an XMVECTOR with float components to an XMVECTOR with int32_t components and applies a uniform bias.
- XMConvert
Vector Float ToUInt - Converts an XMVECTOR with uint32_t components to an XMVECTOR with float components and applies a uniform bias.
- XMConvert
Vector IntTo Float - Converts an XMVECTOR with int32_t components to an XMVECTOR with float components and applies a uniform bias.
- XMConvert
VectorU IntTo Float - Converts an XMVECTOR with uint32_t components to an XMVECTOR with float components and applies a uniform bias.
- XMFresnel
Term - Calculates the Fresnel term for unpolarized light.
- XMLoad
Float2 - Loads data into the x, y, and z components of an XMVECTOR, without type checking.
- XMLoad
Float3 - Loads an XMFLOAT3 into an XMVECTOR.
- XMLoad
Float4 - Loads an XMFLOAT4 into an XMVECTOR.
- XMLoad
Float3A - Loads an XMFLOAT3 into an aligned XMVECTOR.
- XMLoad
Float3x3 - Loads an XMFLOAT3X3 into an MATRIX.
- XMLoad
Float3x4 - Loads an XMFLOAT3X4 into an XMMATRIX.
- XMLoad
Float4A - Loads an XMFLOAT4 into an aligned XMVECTOR.
- XMLoad
Float4x3 - Loads an XMFLOAT4X3 into an XMMATRIX.
- XMLoad
Float4x4 - Loads an XMFLOAT4X4 into an XMMATRIX.
- XMLoad
Float4x4A - Loads an XMFLOAT4X4 into an aligned XMMATRIX.
- XMLoad
Int2 - Loads data into the x and y components of an XMVECTOR.
- XMLoad
Int3 - Loads data into the x, y, and z components of an XMVECTOR, without type checking.
- XMLoad
Int4 - Loads data into an XMVECTOR, without type checking.
- XMMatrix
Affine Transformation - Builds an affine transformation matrix.
- XMMatrix
Affine Transformation2D - Builds a 2D affine transformation matrix in the xy plane.
- XMMatrix
Decompose - Breaks down a general 3D transformation matrix into its scalar, rotational, and translational components.
- XMMatrix
Determinant - Computes the determinant of a matrix.
- XMMatrix
Identity - Builds the identity matrix.
- XMMatrix
Inverse - Computes the inverse of a matrix.
- XMMatrix
IsIdentity - Tests whether a matrix is the identity matrix.
- XMMatrix
IsInfinite - Tests whether any of the elements of a matrix are infinite.
- XMMatrix
IsNaN - Tests whether any of the elements of a matrix are NaN.
- XMMatrix
Look AtLH - Builds a view matrix for a left-handed coordinate system using a camera position, an up direction, and a focal point.
- XMMatrix
Look AtRH - Builds a view matrix for a right-handed coordinate system using a camera position, an up direction, and a focal point.
- XMMatrix
Look ToLH - Builds a view matrix for a left-handed coordinate system using a camera position, an up direction, and a camera direction.
- XMMatrix
Look ToRH - Builds a view matrix for a right-handed coordinate system using a camera position, an up direction, and a camera direction.
- XMMatrix
Multiply - Computes the product of two matrices.
- XMMatrix
Multiply Transpose - Computes the transpose of the product of two matrices.
- XMMatrix
OrthographicLH - Builds an orthogonal projection matrix for a left-handed coordinate system.
- XMMatrix
OrthographicRH - Builds an orthogonal projection matrix for a right-handed coordinate system.
- XMMatrix
Perspective FovLH - Builds a left-handed perspective projection matrix based on a field of view.
- XMMatrix
Perspective FovRH - Builds a right-handed perspective projection matrix based on a field of view.
- XMMatrix
PerspectiveLH - Builds a left-handed perspective projection matrix.
- XMMatrix
Perspective OffCenterLH - Builds a custom version of a left-handed perspective projection matrix.
- XMMatrix
Perspective OffCenterRH - Builds a custom version of a right-handed perspective projection matrix.
- XMMatrix
PerspectiveRH - Builds a right-handed perspective projection matrix.
- XMMatrix
Reflect - Builds a transformation matrix designed to reflect vectors through a given plane.
- XMMatrix
Rotation Axis - Builds a matrix that rotates around an arbitrary axis.
- XMMatrix
Rotation Normal - Builds a matrix that rotates around an arbitrary normal vector.
- XMMatrix
Rotation Quaternion - Builds a rotation matrix from a quaternion.
- XMMatrix
Rotation Roll Pitch Yaw - Builds a rotation matrix based on a given
pitch
,yaw
, androll
(Euler angles). - XMMatrix
Rotation Roll Pitch YawFrom Vector - Builds a rotation matrix based on a vector containing the Euler angles (
pitch
,yaw
, androll
). - XMMatrix
RotationX - Builds a matrix that rotates around the
x-axis
. - XMMatrix
RotationY - Builds a matrix that rotates around the
y-axis
. - XMMatrix
RotationZ - Builds a matrix that rotates around the
z-axis
. - XMMatrix
Scaling - Builds a matrix that scales along the x-axis, y-axis, and z-axis.
- XMMatrix
Scaling From Vector - Builds a matrix that scales along the x-axis, y-axis, and z-axis.
- XMMatrix
Set - Creates a matrix with float values.
- XMMatrix
Shadow - Builds a transformation matrix that flattens geometry into a plane.
- XMMatrix
Transformation - Builds a transformation matrix.
- XMMatrix
Transformation2D - Builds a 2D transformation matrix.
- XMMatrix
Translation - Builds a translation matrix from the specified offsets.
- XMMatrix
Translation From Vector - Builds a translation matrix from a vector.
- XMMatrix
Transpose - Computes the transpose of a matrix.
- XMMatrix
Vector Tensor Product - XMMatrixVectorTensorProduct
- XMMax
- Compares two numeric data type instances, or two instances of an object
which supports an overload of
<
, and returns the larger one of the two instances. The data type of the arguments and the return value is the same. - XMMin
- Compares two numeric data type instances, or two instances of an object
which supports an overload of
<
, and returns the smaller one of the two instances. The data type of the arguments and the return value is the same. - XMPlane
Dot - Calculates the dot product between an input plane and a 4D vector.
- XMPlane
DotCoord - Calculates the dot product between an input plane and a 3D vector.
- XMPlane
DotNormal - Calculates the dot product between the normal vector of a plane and a 3D vector.
- XMPlane
Equal - Determines if two planes are equal.
- XMPlane
From Point Normal - Computes the equation of a plane constructed from a point in the plane and a normal vector.
- XMPlane
From Points - Computes the equation of a plane constructed from three points in the plane.
- XMPlane
Intersect Line - Finds the intersection between a plane and a line.
- XMPlane
Intersect Plane - Finds the intersection of two planes.
- XMPlane
IsInfinite - Tests whether any of the coefficients of a plane is positive or negative infinity.
- XMPlane
IsNaN - Tests whether any of the coefficients of a plane is a NaN.
- XMPlane
Near Equal - Determines whether two planes are nearly equal.
- XMPlane
Normalize - Normalizes the coefficients of a plane so that coefficients of x, y, and z form a unit normal vector.
- XMPlane
Normalize Est - Estimates the coefficients of a plane so that coefficients of x, y, and z form a unit normal vector.
- XMPlane
NotEqual - Determines if two planes are equal.
- XMPlane
Transform - Transforms a plane by a given matrix.
- XMQuaternion
Bary Centric - Returns a point in barycentric coordinates, using the specified quaternions.
- XMQuaternion
Bary CentricV - Returns a point in barycentric coordinates, using the specified quaternions.
- XMQuaternion
Conjugate - Computes the conjugate of a quaternion.
- XMQuaternion
Dot - Computes the dot product of two quaternions.
- XMQuaternion
Equal - Tests whether two quaternions are equal.
- XMQuaternion
Exp - Computes the exponential of a given pure quaternion.
- XMQuaternion
Identity - Returns the identity quaternion.
- XMQuaternion
Inverse - Computes the inverse of a quaternion.
- XMQuaternion
IsIdentity - Tests whether a specific quaternion is the identity quaternion.
- XMQuaternion
IsInfinite - Test whether any component of a quaternion is either positive or negative infinity.
- XMQuaternion
IsNaN - Test whether any component of a quaternion is a NaN.
- XMQuaternion
Length - Computes the magnitude of a quaternion.
- XMQuaternion
Length Sq - Computes the square of the magnitude of a quaternion.
- XMQuaternion
Ln - Computes the natural logarithm of a given unit quaternion.
- XMQuaternion
Multiply - Computes the product of two quaternions.
- XMQuaternion
Normalize - Computes the normalized version of a quaternion.
- XMQuaternion
Normalize Est - Estimates the normalized version of a quaternion.
- XMQuaternion
NotEqual - Tests whether two quaternions are not equal.
- XMQuaternion
Reciprocal Length - Computes the reciprocal of the magnitude of a quaternion.
- XMQuaternion
Rotation Axis - Computes a rotation quaternion about an axis.
- XMQuaternion
Rotation Matrix - Computes a rotation quaternion from a rotation matrix.
- XMQuaternion
Rotation Normal - Computes the rotation quaternion about a normal vector.
- XMQuaternion
Rotation Roll Pitch Yaw - Computes a rotation quaternion based on the
pitch
,yaw
, androll
(Euler angles). - XMQuaternion
Rotation Roll Pitch YawFrom Vector - Computes a rotation quaternion based on a vector containing the Euler angles (
pitch
,yaw
, androll
). - XMQuaternion
Slerp - Interpolates between two unit quaternions, using spherical linear interpolation.
- XMQuaternion
SlerpV - Interpolates between two unit quaternions, using spherical linear interpolation.
- XMQuaternion
Squad - Interpolates between four unit quaternions, using spherical quadrangle interpolation.
- XMQuaternion
Squad Setup - Provides addresses of setup control points for spherical quadrangle interpolation.
- XMQuaternion
SquadV - Interpolates between four unit quaternions, using spherical quadrangle interpolation.
- XMQuaternion
ToAxis Angle - Computes an axis and angle of rotation about that axis for a given quaternion.
- XMScalarA
Cos - Computes the arccosine of a floating-point number.
- XMScalarA
CosEst - Estimates the arccosine of a floating-point number.
- XMScalarA
Sin - Computes the arcsine of a floating-point number.
- XMScalarA
SinEst - Estimates the arcsine of a floating-point number.
- XMScalar
Cos - Computes the cosine of a radian angle.
- XMScalar
CosEst - Estimates the cosine of a radian angle.
- XMScalar
ModAngle - Computes an angle between
-XM_PI
andXM_PI
. - XMScalar
Near Equal - Determines if two floating-point values are nearly equal.
- XMScalar
Sin - Computes the sine of a radian angle.
- XMScalar
SinCos - Computes both the sine and cosine of a radian angle.
- XMScalar
SinCos Est - Estimates both the sine and cosine of a radian angle.
- XMScalar
SinEst - Estimates the sine of a radian angle.
- XMStore
Float - Stores an XMVECTOR in a float.
- XMStore
Float2 - Stores an XMVECTOR in an XMFLOAT2.
- XMStore
Float3 - Stores an XMVECTOR in an XMFLOAT3.
- XMStore
Float4 - Stores an XMVECTOR in an XMFLOAT4.
- XMStore
Float3A - Stores an XMVECTOR in an aligned XMFLOAT3.
- XMStore
Float3x3 - Stores an XMMATRIX in an XMFLOAT3X3.
- XMStore
Float3x4 - Stores an XMMATRIX in an XMFLOAT3X4.
- XMStore
Float4A - Stores an XMVECTOR in an aligned XMFLOAT4.
- XMStore
Float4x3 - Stores an XMMATRIX in an XMFLOAT4X3.
- XMStore
Float4x4 - Stores an XMMATRIX in an XMFLOAT4X4.
- XMStore
Float4x4A - Stores an XMMATRIX in an aligned XMFLOAT4X4.
- XMStore
Int2 - Stores an XMVECTOR in a 2-element uint32_t array.
- XMStore
Int3 - Stores an XMVECTOR in a 3-element uint32_t array.
- XMStore
Int4 - Stores an XMVECTOR in a 4-element uint32_t array.
- XMVector2
Angle Between Normals - Computes the radian angle between two normalized 2D vectors.
- XMVector2
Angle Between Normals Est - Estimates the radian angle between two normalized 2D vectors.
- XMVector2
Angle Between Vectors - Computes the radian angle between two 2D vectors.
- XMVector2
Clamp Length - Clamps the length of a 2D vector to a given range.
- XMVector2
Clamp LengthV - Clamps the length of a 2D vector to a given range.
- XMVector2
Cross - Computes the 2D cross product.
- XMVector2
Dot - Computes the dot product between 2D vectors.
- XMVector2
Equal - Tests whether two 2D vectors are equal.
- XMVector2
Equal Int - Tests whether two 2D vectors are equal, treating each component as an unsigned integer.
- XMVector2
Equal IntR - Tests whether two 2D vectors are equal, treating each component as an unsigned integer. In addition, this function returns a comparison value that can be examined using functions such as XMComparisonAllTrue.
- XMVector2
EqualR - Tests whether two 2D vectors are equal. In addition, this function returns a comparison value that can be examined using functions such as XMComparisonAllTrue.
- XMVector2
Greater - Tests whether one 2D vector is greater than another 2D vector.
- XMVector2
Greater OrEqual - Tests whether one 2D vector is greater-than-or-equal-to another 2D vector.
- XMVector2
Greater OrEqualR - Tests whether one 2D vector is greater-than-or-equal-to another 2D vector and returns a comparison value that can be examined using functions such as XMComparisonAllTrue.
- XMVector2
GreaterR - Tests whether one 2D vector is greater than another 2D vector and returns a comparison value that can be examined using functions such as XMComparisonAllTrue.
- XMVector2
InBounds - Tests whether the components of a 2D vector are within set bounds.
- XMVector2
Intersect Line - Finds the intersection of two lines.
- XMVector2
IsInfinite - Tests whether any component of a 2D vector is positive or negative infinity.
- XMVector2
IsNaN - Tests whether any component of a 2D vector is a NaN.
- XMVector2
Length - Computes the length of a 2D vector.
- XMVector2
Length Est - Estimates the length of a 2D vector.
- XMVector2
Length Sq - Computes the square of the length of a 2D vector.
- XMVector2
Less - Tests whether one 2D vector is less than another 2D vector.
- XMVector2
Less OrEqual - Tests whether one 2D vector is less-than-or-equal-to another 2D vector.
- XMVector2
Line Point Distance - Computes the minimum distance between a line and a point.
- XMVector2
Near Equal - Tests whether one 2D vector is near another 2D vector.
- XMVector2
Normalize - Returns the normalized version of a 2D vector.
- XMVector2
Normalize Est - Estimates the normalized version of a 2D vector.
- XMVector2
NotEqual - Tests whether two 2D vectors are not equal.
- XMVector2
NotEqual Int - Test whether two vectors are not equal, treating each component as an unsigned integer.
- XMVector2
Orthogonal - Computes a vector perpendicular to a 2D vector.
- XMVector2
Reciprocal Length - Computes the reciprocal of the length of a 2D vector.
- XMVector2
Reciprocal Length Est - Estimates the reciprocal of the length of a 2D vector.
- XMVector2
Reflect - Reflects an incident 2D vector across a 2D normal vector.
- XMVector2
Refract - Refracts an incident 2D vector across a 2D normal vector.
- XMVector2
RefractV - Refracts an incident 2D vector across a 2D normal vector.
- XMVector2
Transform - Transforms a 2D vector by a matrix.
- XMVector2
Transform Coord - Transforms a 2D vector by a given matrix, projecting the result back into
w = 1
. - XMVector2
Transform Normal - Transforms a 2D vector by a matrix.
- XMVector3
Angle Between Normals - Computes the radian angle between two normalized 3D vectors.
- XMVector3
Angle Between Normals Est - Estimates the radian angle between two normalized 3D vectors.
- XMVector3
Angle Between Vectors - Computes the radian angle between two 3D vectors.
- XMVector3
Clamp Length - Clamps the length of a 3D vector to a given range.
- XMVector3
Clamp LengthV - Clamps the length of a 3D vector to a given range.
- XMVector3
Components From Normal - Using a reference normal vector, splits a 3D vector into components that are parallel and perpendicular to the normal.
- XMVector3
Cross - Computes the cross product between 3D vectors.
- XMVector3
Dot - Computes the dot product between 3D vectors.
- XMVector3
Equal - Tests whether two 3D vectors are equal.
- XMVector3
Equal Int - Tests whether two 3D vectors are equal, treating each component as an unsigned integer.
- XMVector3
Equal IntR - Tests whether two 3D vectors are equal, treating each component as an unsigned integer. In addition, this function returns a comparison value that can be examined using functions such as XMComparisonAllTrue.
- XMVector3
EqualR - Tests whether two 3D vectors are equal. In addition, this function returns a comparison value that can be examined using functions such as XMComparisonAllTrue.
- XMVector3
Greater - Tests whether one 3D vector is greater than another 3D vector.
- XMVector3
Greater OrEqual - Tests whether one 3D vector is greater-than-or-equal-to another 3D vector.
- XMVector3
Greater OrEqualR - Tests whether one 3D vector is greater-than-or-equal-to another 3D vector and returns a comparison value that can be examined using functions such as XMComparisonAllTrue.
- XMVector3
GreaterR - Tests whether one 3D vector is greater than another 3D vector and returns a comparison value that can be examined using functions such as XMComparisonAllTrue.
- XMVector3
InBounds - Tests whether the components of a 3D vector are within set bounds.
- XMVector3
Inverse Rotate - Rotates a 3D vector using the inverse of a quaternion.
- XMVector3
IsInfinite - Tests whether any component of a 3D vector is positive or negative infinity.
- XMVector3
IsNaN - Tests whether any component of a 3D vector is a NaN.
- XMVector3
Length - Computes the length of a 3D vector.
- XMVector3
Length Est - Estimates the length of a 3D vector.
- XMVector3
Length Sq - Computes the square of the length of a 3D vector.
- XMVector3
Less - Tests whether one 3D vector is less than another 3D vector.
- XMVector3
Less OrEqual - Tests whether one 3D vector is less than or equal to another 3D vector.
- XMVector3
Line Point Distance - Computes the minimum distance between a line and a point.
- XMVector3
Near Equal - Tests whether one 3D vector is near another 3D vector.
- XMVector3
Normalize - Returns the normalized version of a 3D vector.
- XMVector3
Normalize Est - Estimates the normalized version of a 3D vector.
- XMVector3
NotEqual - Tests whether two 3D vectors are not equal.
- XMVector3
NotEqual Int - Test whether two 3D vectors are not equal, treating each component as an unsigned integer.
- XMVector3
Orthogonal - Computes a vector perpendicular to a 3D vector.
- XMVector3
Project - Project a 3D vector from object space into screen space.
- XMVector3
Reciprocal Length - Computes the reciprocal of the length of a 3D vector.
- XMVector3
Reciprocal Length Est - Estimates the reciprocal of the length of a 3D vector.
- XMVector3
Reflect - Reflects an incident 3D vector across a 3D normal vector.
- XMVector3
Refract - Refracts an incident 3D vector across a 3D normal vector.
- XMVector3
RefractV - Refracts an incident 3D vector across a 3D normal vector.
- XMVector3
Rotate - Rotates a 3D vector using a quaternion.
- XMVector3
Transform - Transforms a 3D vector by a matrix.
- XMVector3
Transform Coord - Transforms a 3D vector by a given matrix, projecting the result back into
w = 1
. - XMVector3
Transform Normal - Transforms the 3D vector normal by the given matrix.
- XMVector3
Unproject - Projects a 3D vector from screen space into object space.
- XMVector4
Angle Between Normals - Computes the radian angle between two normalized 4D vectors.
- XMVector4
Angle Between Normals Est - Estimates the radian angle between two normalized 4D vectors.
- XMVector4
Angle Between Vectors - Compute the radian angle between two 4D vectors.
- XMVector4
Clamp Length - Clamps the length of a 4D vector to a given range.
- XMVector4
Clamp LengthV - Clamps the length of a 4D vector to a given range.
- XMVector4
Cross - Computes the cross product between 4D vectors.
- XMVector4
Dot - Computes the dot product between 4D vectors.
- XMVector4
Equal - Tests whether two 4D vectors are equal.
- XMVector4
Equal Int - Tests whether two 4D vectors are equal, treating each component as an unsigned integer.
- XMVector4
Equal IntR - Tests whether two 4D vectors are equal, treating each component as an unsigned integer. In addition, this function returns a comparison value that can be examined using functions such as XMComparisonAllTrue.
- XMVector4
EqualR - Tests whether two 4D vectors are equal. In addition, this function returns a comparison value that can be examined using functions such as XMComparisonAllTrue.
- XMVector4
Greater - Tests whether one 4D vector is greater than another 4D vector.
- XMVector4
Greater OrEqual - Tests whether one 4D vector is greater-than-or-equal-to another 4D vector.
- XMVector4
Greater OrEqualR - Tests whether one 4D vector is greater-than-or-equal-to another 4D vector and returns a comparison value that can be examined using functions such as XMComparisonAllTrue.
- XMVector4
GreaterR - Tests whether one 4D vector is greater than another 4D vector and returns a comparison value that can be examined using functions such as XMComparisonAllTrue.
- XMVector4
InBounds - Tests whether the components of a 4D vector are within set bounds.
- XMVector4
IsInfinite - Tests whether any component of a 4D vector is a NaN.
- XMVector4
IsNaN - Tests whether any component of a 4D vector is a NaN.
- XMVector4
Length - Computes the length of a 4D vector.
- XMVector4
Length Est - Estimates the length of a 4D vector.
- XMVector4
Length Sq - Computes the square of the length of a 4D vector.
- XMVector4
Less - Tests whether one 4D vector is less than another 4D vector.
- XMVector4
Less OrEqual - Tests whether one 4D vector is less than or equal to another 4D vector.
- XMVector4
Near Equal - Tests whether one 4D vector is near another 4D vector.
- XMVector4
Normalize - Computes the normalized version of a 4D vector.
- XMVector4
Normalize Est - Estimates the normalized version of a 4D vector.
- XMVector4
NotEqual - Tests whether two 4D vectors are not equal.
- XMVector4
NotEqual Int - Test whether two 4D vectors are not equal, treating each component as an unsigned integer.
- XMVector4
Orthogonal - Computes a vector perpendicular to a 4D vector.
- XMVector4
Reciprocal Length - Computes the reciprocal of the length of a 4D vector.
- XMVector4
Reciprocal Length Est - Estimates the reciprocal of the length of a 4D vector.
- XMVector4
Reflect - Reflects an incident 4D vector across a 4D normal vector.
- XMVector4
Refract - Reflects an incident 4D vector across a 4D normal vector.
- XMVector4
RefractV - Computes a vector perpendicular to a 4D vector.
- XMVector4
Transform - Transforms a 4D vector by a matrix.
- XMVectorA
Cos - Computes the arccosine of each component of an XMVECTOR.
- XMVectorA
CosEst - Estimates the arccosine of each component of an XMVECTOR.
- XMVectorA
Sin - Computes the arcsine of each component of an XMVECTOR.
- XMVectorA
SinEst - Estimates the arcsine of each component of an XMVECTOR.
- XMVectorA
Tan - Computes the arctangent of each component of an XMVECTOR.
- XMVectorA
Tan2 - Computes the arctangent of Y/X.
- XMVectorA
Tan2 Est - Estimates the arctangent of Y/X.
- XMVectorA
TanEst - Estimates the arctangent of each component of an XMVECTOR.
- XMVector
Abs - Computes the absolute value of each component of an XMVECTOR.
- XMVector
Add - Computes the sum of two vectors.
- XMVector
AddAngles - Adds two vectors representing angles.
- XMVector
AndC Int - Computes the logical AND of one vector with the negation of a second vector, treating each component as an unsigned integer.
- XMVector
AndInt - Computes the logical AND of two vectors, treating each component as an unsigned integer.
- XMVector
Bary Centric - Returns a point in Barycentric coordinates, using the specified position vectors.
- XMVector
Bary CentricV - Returns a point in Barycentric coordinates, using the specified position vectors.
- XMVector
Catmull Rom - Performs a Catmull-Rom interpolation, using the specified position vectors.
- XMVector
Catmull RomV - Performs a Catmull-Rom interpolation, using the specified position vectors.
- XMVector
Ceiling - Computes the ceiling of each component of an XMVECTOR.
- XMVector
Clamp - Clamps the components of a vector to a specified minimum and maximum range.
- XMVector
Cos - Computes the cosine of each component of an XMVECTOR.
- XMVector
CosEst - Estimates the cosine of each component of an XMVECTOR.
- XMVector
CosH - Computes the hyperbolic cosine of each component of an XMVECTOR.
- XMVector
Divide - Divides one instance of XMVECTOR by a second instance, returning the result in a third instance.
- XMVector
Equal - Performs a per-component test for equality of two vectors.
- XMVector
Equal Int - Performs a per-component test for the equality of two vectors, treating each component as an unsigned integer.
- XMVector
Equal IntR - Performs a per-component test for equality of two vectors, treating each component as an unsigned integer. In addition, this function sets a comparison value that can be examined using functions such as XMComparisonAllTrue.
- XMVector
EqualR - Performs a per-component test for equality of two vectors and sets a comparison value that can be examined using functions such as XMComparisonAllTrue.
- XMVector
Exp - Computes two raised to the power for each component.
- XMVector
Exp2 - Computes two raised to the power for each component.
- XMVector
False Int - Returns the zero (false) vector.
- XMVector
Floor - Computes the floor of each component of an XMVECTOR.
- XMVector
GetBy Index - Retrieve the value of one of the four components of an XMVECTOR Data Type containing floating-point data by index.
- XMVector
GetInt ByIndex - Retrieve the value of one of the four components of an XMVECTOR Data Type containing integer data by index.
- XMVector
GetIntW - Retrieve the
w
component of an XMVECTOR Data Type. - XMVector
GetIntX - Retrieve the
x
component of an XMVECTOR Data Type. - XMVector
GetIntY - Retrieve the
y
component of an XMVECTOR Data Type. - XMVector
GetIntZ - Retrieve the
z
component of an XMVECTOR Data Type. - XMVector
GetW - Retrieve the
w
component of an XMVECTOR Data Type. - XMVector
GetW Ptr - Retrieve the
w
component of an XMVECTOR Data Type containing floating-point data, and storing that component’s value in an instance of float referred to by a pointer. - XMVector
GetX - Retrieve the
x
component of an XMVECTOR Data Type. - XMVector
GetX Ptr - Retrieve the
x
component of an XMVECTOR Data Type containing floating-point data, and storing that component’s value in an instance of float referred to by a pointer. - XMVector
GetY - Retrieve the
y
component of an XMVECTOR Data Type. - XMVector
GetY Ptr - Retrieve the
y
component of an XMVECTOR Data Type containing floating-point data, and storing that component’s value in an instance of float referred to by a pointer. - XMVector
GetZ - Retrieve the
z
component of an XMVECTOR Data Type. - XMVector
GetZ Ptr - Retrieve the
z
component of an XMVECTOR Data Type containing floating-point data, and storing that component’s value in an instance of float referred to by a pointer. - XMVector
Greater - Performs a per-component test for greater-than between two vectors.
- XMVector
Greater OrEqual - Performs a per-component test for greater-than-or-equal between two vectors.
- XMVector
Greater OrEqualR - Performs a per-component test for greater-than-or-equal between two vectors and sets a comparison value that can be examined using functions such as XMComparisonAllTrue.
- XMVector
GreaterR - Performs a per-component test for greater-than between two vectors and sets a comparison value that can be examined using functions such as XMComparisonAllTrue.
- XMVector
Hermite - Performs a Hermite spline interpolation, using the specified vectors.
- XMVector
HermiteV - Performs a Hermite spline interpolation, using the specified vectors.
- XMVector
InBounds - Tests whether the components of a given vector are within set bounds.
- XMVector
InBoundsR - Tests whether the components of a given vector are within certain bounds and sets a comparison value that can be examined using functions such as XMComparisonAllTrue.
- XMVector
Insert - Rotates a vector left by a given number of 32-bit components and insert selected elements of that result into another vector.
- XMVector
IsInfinite - Performs a per-component test for +/- infinity on a vector.
- XMVector
IsNaN - Performs a per-component NaN test on a vector.
- XMVector
Lerp - Performs a linear interpolation between two vectors.
- XMVector
LerpV - Performs a linear interpolation between two vectors.
- XMVector
Less - Performs a per-component test for less-than between two vectors.
- XMVector
Less OrEqual - Performs a per-component test for less-than-or-equal between two vectors.
- XMVector
Max - Makes a per-component comparison between two vectors, and returns a vector containing the largest components.
- XMVector
MergeXY - Creates a new vector by combining the
x
andy
-components of two vectors. - XMVector
MergeZW - Creates a new vector by combining the
z
andw
-components of two vectors. - XMVector
Min - Makes a per-component comparison between two vectors, and returns a vector containing the smallest components.
- XMVector
Mod - Computes the per-component floating-point remainder of the quotient of two vectors.
- XMVector
ModAngles - Computes the per-component angle modulo 2PI.
- XMVector
Multiply - Computes the per-component product of two vectors.
- XMVector
Multiply Add - Computes the product of the first two vectors added to the third vector.
- XMVector
Near Equal - Performs a per-component test for equality of two vectors within a given threshold.
- XMVector
Negate - Computes the negation of a vector.
- XMVector
Negative Multiply Subtract - Computes the difference of a third vector and the product of the first two vectors.
- XMVector
NorInt - Computes the logical NOR of two vectors, treating each component as an unsigned integer.
- XMVector
NotEqual - Performs a per-component test for the inequality of two vectors.
- XMVector
NotEqual Int - Performs a per-component test for the inequality of two vectors, treating each component as an unsigned integer.
- XMVector
OrInt - Computes the logical OR of two vectors, treating each component as an unsigned integer.
- XMVector
Permute - Permutes the components of two vectors to create a new vector.
- XMVector
Pow - Computes V1 raised to the power of V2.
- XMVector
Reciprocal - Estimates the per-component reciprocal of a vector.
- XMVector
Reciprocal Est - Estimates the per-component reciprocal of a vector.
- XMVector
Reciprocal Sqrt - Computes the per-component reciprocal square root of a vector.
- XMVector
Reciprocal Sqrt Est - Estimates the per-component reciprocal square root of a vector.
- XMVector
Replicate - Replicates a floating-point value into all four components of a vector.
- XMVector
Replicate Int - Replicates an integer value into all four components of a vector.
- XMVector
Replicate Ptr - Replicates a floating-point value referenced by pointer into all four components of a vector.
- XMVector
Rotate Left - Rotates the vector left by a given number of 32-bit elements.
- XMVector
Rotate Right - Rotates the vector right by a given number of 32-bit elements.
- XMVector
Round - Rounds each component of a vector to the nearest even integer (known as “Bankers Rounding”).
- XMVector
Saturate - Saturates each component of a vector to the range 0.0f to 1.0f.
- XMVector
Scale - Scalar multiplies a vector by a floating-point value.
- XMVector
Select - Performs a per-component selection between two input vectors and returns the resulting vector.
- XMVector
Select Control - Defines a control vector for use in XMVectorSelect.
- XMVector
Set - Creates a vector using four floating-point values.
- XMVector
SetBinary Constant - Creates a vector, each of whose components is either
0.0
or1.0
. - XMVector
SetBy Index - Use a floating-point object to set the value of one of the four components of an XMVECTOR Data Type containing integer data referenced by an index.
- XMVector
SetInt - Creates a vector with unsigned integer components.
- XMVector
SetInt ByIndex - Use an integer instance to set the value of one of the four components of an XMVECTOR Data Type containing integer data referenced by an index.
- XMVector
SetIntW - Set the value of the
w
component of an XMVECTOR Data Type. - XMVector
SetIntX - Set the value of the
x
component of an XMVECTOR Data Type. - XMVector
SetIntY - Set the value of the
y
component of an XMVECTOR Data Type. - XMVector
SetIntZ - Set the value of the
z
component of an XMVECTOR Data Type. - XMVector
SetW - Set the value of the
w
component of an XMVECTOR Data Type. - XMVector
SetX - Set the value of the
x
component of an XMVECTOR Data Type. - XMVector
SetY - Set the value of the
y
component of an XMVECTOR Data Type. - XMVector
SetZ - Set the value of the
z
component of an XMVECTOR Data Type. - XMVector
Shift Left - Shifts a vector left by a given number of 32-bit elements, filling the vacated elements with elements from a second vector.
- XMVector
Sin - Computes the sine of each component of an XMVECTOR.
- XMVector
SinCos - Computes the sine and cosine of each component of an XMVECTOR.
- XMVector
SinCos Est - Estimates the sine and cosine of each component of an XMVECTOR.
- XMVector
SinEst - Estimates the sine of each component of an XMVECTOR.
- XMVector
SinH - Computes the hyperbolic sine of each component of an XMVECTOR.
- XMVector
Splat Constant - Creates a vector with identical floating-point components. Each component is a constant divided by two raised to an integer exponent.
- XMVector
Splat Constant Int - Creates a vector with identical integer components.
- XMVector
Splat Epsilon - Returns a vector, each of whose components are epsilon (
1.192092896e-7
). - XMVector
Splat Infinity - Returns a vector, each of whose components are infinity (
0x7F800000
). - XMVector
Splat One - Returns a vector, each of whose components are one.
- XMVector
SplatQ NaN - Returns a vector, each of whose components are QNaN (
0x7CF00000
). - XMVector
Splat Sign Mask - Returns a vector, each of whose components are the sign mask (
0x80000000
). - XMVector
SplatW - Replicates the
w
component of a vector to all of the components. - XMVector
SplatX - Replicates the
x
component of a vector to all of the components. - XMVector
SplatY - Replicates the
y
component of a vector to all of the components. - XMVector
SplatZ - Replicates the
z
component of a vector to all of the components. - XMVector
Sqrt - Computes the per-component square root of a vector.
- XMVector
Sqrt Est - Estimates the per-component square root of a vector.
- XMVector
Subtract - Computes the difference of two vectors.
- XMVector
Subtract Angles - Subtracts two vectors representing angles.
- XMVector
Sum - Computes the horizontal sum of the components of an XMVECTOR. The horizontal sum is the result of adding each component in the vector together.
- XMVector
Swizzle - Swizzles a vector.
- XMVector
Tan - Computes the tangent of each component of an XMVECTOR.
- XMVector
TanEst - Estimates the tangent of each component of an XMVECTOR.
- XMVector
TanH - Computes the hyperbolic tangent of each component of an XMVECTOR.
- XMVector
True Int - Returns a vector, each of whose components represents true (
0xFFFFFFFF
). - XMVector
Truncate - Rounds each component of a vector to the nearest integer value in the direction of zero.
- XMVector
XorInt - Computes the logical XOR of two vectors, treating each component as an unsigned integer.
- XMVector
Zero - Creates the zero vector.
Type Aliases§
- CXMMATRIX
- CXMVECTOR
- FXMMATRIX
- FXMVECTOR
- GXMVECTOR
- HALF
- A 16-bit floating point number consisting of a sign bit, a 5-bit biased exponent, and a 10-bit mantissa.
- HXMVECTOR
- XMVECTOR
- XM_
PERMUTE_ 0W - XM_
PERMUTE_ 0X - XM_
PERMUTE_ 0Y - XM_
PERMUTE_ 0Z - XM_
PERMUTE_ 1W - XM_
PERMUTE_ 1X - XM_
PERMUTE_ 1Y - XM_
PERMUTE_ 1Z - XM_
SWIZZLE_ W - XM_
SWIZZLE_ X - XM_
SWIZZLE_ Y - XM_
SWIZZLE_ Z