XMStoreFloat4x4

XMFLOAT4X4XMMATRIX を格納します。

構文

VOID XMStoreFloat4x4(         XMFLOAT4X4 *pDestination,         XMMATRIX M)

パラメーター

  • pDestination
    [out] データを格納するアドレス
  • M
    [in] 格納するデータが含まれる行列

戻り値

なし。

解説 

この関数は行列を受け取り、指定されたアドレスにある 16 個の単精度浮動小数点値に要素を書き込みます。1 行目のベクトルの最上位要素がアドレスの最初の 4 バイトに書き込まれ、次に 1 行目の上位 2 番目の要素、以降同様に順次書き込まれます。次に、2 行目がメモリのバイト 16 以降に書き込まれ、3 行目がバイト 32 以降、4 行目がバイト 48 以降に書き込まれます。

次の擬似コードは、この関数の処理を表したものです。

pDestination->_11 = M[0].x; // 4 bytes to address (BYTE*)pDestinationpDestination->_12 = M[0].y; // 4 bytes to address (BYTE*)pDestination + 4pDestination->_13 = M[0].z; // 4 bytes to address (BYTE*)pDestination + 8pDestination->_14 = M[0].w; // 4 bytes to address (BYTE*)pDestination + 12pDestination->_21 = M[1].x; // 4 bytes to address (BYTE*)pDestination + 16pDestination->_22 = M[1].y; // 4 bytes to address (BYTE*)pDestination + 20pDestination->_23 = M[1].z; // 4 bytes to address (BYTE*)pDestination + 24pDestination->_24 = M[1].w; // 4 bytes to address (BYTE*)pDestination + 28pDestination->_31 = M[2].x; // 4 bytes to address (BYTE*)pDestination + 32pDestination->_32 = M[2].y; // 4 bytes to address (BYTE*)pDestination + 36pDestination->_33 = M[2].z; // 4 bytes to address (BYTE*)pDestination + 40pDestination->_34 = M[2].w; // 4 bytes to address (BYTE*)pDestination + 44pDestination->_41 = M[3].x; // 4 bytes to address (BYTE*)pDestination + 48pDestination->_42 = M[3].y; // 4 bytes to address (BYTE*)pDestination + 52pDestination->_43 = M[3].z; // 4 bytes to address (BYTE*)pDestination + 56pDestination->_44 = M[3].w; // 4 bytes to address (BYTE*)pDestination + 60

要件

ヘッダー: xnamath.h で宣言されています。