XMStoreUDecN4 函数 (directxpackedvector.h)

XMVECTOR 存储在 XMUDECN4中。

语法

void XM_CALLCONV XMStoreUDecN4(
  [out] XMUDECN4  *pDestination,
  [in]  FXMVECTOR V
) noexcept;

参数

[out] pDestination

存储数据的地址。

[in] V

包含要存储的数据的向量。

返回值

无。

备注

以下伪代码演示函数的操作。

XMVECTOR N;	
static const XMVECTOR  Scale = {1023.0f, 1023.0f, 1023.0f, 3.0f};

assert(pDestination);

N = XMVectorClamp(V, XMVectorZero(), g_XMOne);
N = XMVectorMultiply(N, Scale);

pDestination->v = ((uint32_t)N.v[3] << 30) |
                  (((uint32_t)N.v[2] & 0x3FF) << 20) |
                  (((uint32_t)N.v[1] & 0x3FF) << 10) |
                  (((uint32_t)N.v[0] & 0x3FF));

平台要求

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

要求

要求
目标平台 Windows
标头 directxpackedvector.h (包括 DirectXPackedVector.h)

另请参阅

DirectXMath 库向量存储函数