Function directx_math::XMVector3ClampLength[][src]

pub fn XMVector3ClampLength(
    V: FXMVECTOR,
    LengthMin: f32,
    LengthMax: f32
) -> FXMVECTOR

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

Parameters

V 3D vector to clamp.

LengthMin 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 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

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.

Reference

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