XMVectorSaturate

Saturates each component of a vector to the range 0.0f to 1.0f.

Syntax

XMVECTOR XMVectorSaturate(
         XMVECTOR V
)  

Parameters

V
Type: XMVECTOR 

Vector to saturate.

Return value

Type: XMVECTOR 

Returns a vector, each of whose components are saturated.

Remarks

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;  

Requirements

Header: Declared in directxmath.h.