XMVector4ClampLengthV 函数 (directxmath.h)

将 4D 向量的长度固定到给定范围。

语法

XMVECTOR XM_CALLCONV XMVector4ClampLengthV(
  [in] FXMVECTOR V,
  [in] FXMVECTOR LengthMin,
  [in] FXMVECTOR LengthMax
) noexcept;

参数

[in] V

要固定的 4D 矢量。

[in] LengthMin

4D 向量,其所有组件都等于最小固定长度。 组件必须大于或等于零。

[in] LengthMax

4D 矢量,其所有分量都等于最大固定长度。 组件必须大于或等于零。

返回值

返回一个 4D 向量,其长度固定到指定的最小值和最大值。

备注

此函数与 XMVector4ClampLength 相同,只不过 LengthMinLengthMax 是使用 4D 向量而不是 浮点 值提供的。

平台要求

带有 Windows SDK for Windows 8 的 Microsoft Visual Studio 2010 或 Microsoft Visual Studio 2012。 支持 Win32 桌面应用、Windows 应用商店应用和 Windows Phone 8 应用。

要求

   
目标平台 Windows
标头 directxmath.h (包括 DirectXMath.h)

请参阅

DirectXMath 库 4D 矢量几何函数

XMVector4ClampLength