Saturates each component of a vector to the range 0.0f to 1.0f.
XMVECTOR XMVectorSaturate(
XMVECTOR V
)
V
Type: XMVECTOR
Vector to saturate.
Type: XMVECTOR
Returns a vector, each of whose components are saturated.
The following pseudocode demonstrates the operation of the function:
XMVECTOR Result;
Result.x = min(max(V1.x, 0.0f), 1.0f);
Result.y = min(max(V1.y, 0.0f), 1.0f);
Result.z = min(max(V1.z, 0.0f), 1.0f);
Result.w = min(max(V1.w, 0.0f), 1.0f);
return Result;
Header: Declared in directxmath.h.