Share via


XMStoreFloat4x4 関数 (directxmath.h)

XMMATRIXXMFLOAT4X4に格納します。

構文

void XM_CALLCONV XMStoreFloat4x4(
  [out] XMFLOAT4X4 *pDestination,
  [in]  FXMMATRIX  M
) noexcept;

パラメーター

[out] pDestination

データを格納するアドレス。

[in] M

格納するデータを含むマトリックス。

戻り値

[なし] :

解説

XMFLOAT4X4 は行主行列形式です。 列メジャー データを書き出すには、ストア関数を呼び出す前に XMMatrixTranpose を使用して XMMATRIX を入れ替える必要があります。

この関数は行列を受け取り、指定されたアドレスで 16 個の単精度浮動小数点値にコンポーネントを書き込みます。 最初の行ベクトルの最も重要なコンポーネントは、アドレスの最初の 4 バイトに書き込まれ、次に最初の行の 2 番目に重要なコンポーネントに書き込まれます。 2 番目の行は、バイト 16 で始まるメモリに同様の方法で書き込まれ、バイト 32 で始まる 3 行目がメモリに続き、最後にバイト 48 から始まる 4 行目がメモリに書き込まれます。

次の擬似コードは、 関数の操作を示しています。

pDestination->_11 = M[0].x; // 4 bytes to address (uint8_t*)pDestination
pDestination->_12 = M[0].y; // 4 bytes to address (uint8_t*)pDestination + 4
pDestination->_13 = M[0].z; // 4 bytes to address (uint8_t*)pDestination + 8
pDestination->_14 = M[0].w; // 4 bytes to address (uint8_t*)pDestination + 12

pDestination->_21 = M[1].x; // 4 bytes to address (uint8_t*)pDestination + 16
pDestination->_22 = M[1].y; // 4 bytes to address (uint8_t*)pDestination + 20
pDestination->_23 = M[1].z; // 4 bytes to address (uint8_t*)pDestination + 24
pDestination->_24 = M[1].w; // 4 bytes to address (uint8_t*)pDestination + 28

pDestination->_31 = M[2].x; // 4 bytes to address (uint8_t*)pDestination + 32
pDestination->_32 = M[2].y; // 4 bytes to address (uint8_t*)pDestination + 36
pDestination->_33 = M[2].z; // 4 bytes to address (uint8_t*)pDestination + 40
pDestination->_34 = M[2].w; // 4 bytes to address (uint8_t*)pDestination + 44

pDestination->_41 = M[3].x; // 4 bytes to address (uint8_t*)pDestination + 48
pDestination->_42 = M[3].y; // 4 bytes to address (uint8_t*)pDestination + 52
pDestination->_43 = M[3].z; // 4 bytes to address (uint8_t*)pDestination + 56
pDestination->_44 = M[3].w; // 4 bytes to address (uint8_t*)pDestination + 60

プラットフォームの要件

Windows 8のWindows SDKを含む Microsoft Visual Studio 2010 または Microsoft Visual Studio 2012。 Win32 デスクトップ アプリ、Windows ストア アプリ、Windows Phone 8 アプリでサポートされます。

要件

要件
対象プラットフォーム Windows
ヘッダー directxmath.h

こちらもご覧ください

DirectXMath ライブラリ ベクター ストア関数