XMVector3ClampLength

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

Syntax

XMVECTOR XMVector3ClampLength(
         XMVECTOR V,
         float LengthMin,
         float LengthMax
)  

Parameters

V
Type: XMVECTOR 

3D vector.

LengthMin
Type: float 

Minimum clamp length.

LengthMax
Type: float 

Maximum clamp length.

Return value

Type: XMVECTOR 

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

Requirements

Header: Declared in directxmath.h.