XMVector3ClampLengthV

Clamps the length of a 3D vector to a given range.

Syntax

XMVECTOR XMVector3ClampLengthV(
         XMVECTOR V,
         XMVECTOR LengthMin,
         XMVECTOR LengthMax
)  

Parameters

V
Type: XMVECTOR 

3D vector to clamp.

LengthMin
Type: XMVECTOR 

3D vector whose x, y, and z-components are equal to the minimum clamp length. The x, y, and z-components must be greater-than-or-equal to zero.

LengthMax
Type: XMVECTOR 

3D vector whose x, y, and z-components are equal to the minimum clamp length. The x, y, and z-components must be greater-than-or-equal to zero.

Return value

Type: XMVECTOR 

Returns a 3D vector whose length is clamped to the specified minimum and maximum.

Remarks

This function is identical to XMVector3ClampLength except that LengthMin and LengthMax are supplied using 3D vectors instead of float values.

Requirements

Header: Declared in directxmath.h.