[][src]Function directx_math::XMVectorSaturate

pub fn XMVectorSaturate(V: FXMVECTOR) -> XMVECTOR

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

Parameters

V Vector to saturate.

Return value

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;

Reference

https://docs.microsoft.com/en-us/windows/win32/api/directxmath/nf-directxmath-XMVectorSaturate