Clamps the components of a vector to a specified minimum and maximum range.
XMVECTOR XMVectorClamp(
XMVECTOR V,
XMVECTOR Min,
XMVECTOR Max
)
V
Type: XMVECTOR
Vector whose components are to be clamped.
Min
Type: XMVECTOR
Minimum range vector.
Max
Type: XMVECTOR
Maximum range vector.
Type: XMVECTOR
Returns a vector whose components are clamped to the specified minimum and maximum values.
The following pseudocode demonstrates the operation of the function:
XMVECTOR Result;
Result.x = min( max( V.x, Min.x ), Max.x );
Result.y = min( max( V.y, Min.y ), Max.y );
Result.z = min( max( V.z, Min.z ), Max.z );
Result.w = min( max( V.w, Min.w ), Max.w );
return Result;
Header: Declared in directxmath.h.