XMStoreFloat4x4-Funktion (directxmath.h)

Speichert eine XMMATRIX in einer XMFLOAT4X4.

Syntax

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

Parameter

[out] pDestination

Adresse, an der die Daten gespeichert werden sollen.

[in] M

Matrix mit den zu speichernden Daten.

Rückgabewert

Keine.

Hinweise

XMFLOAT4X4 ist ein Zeilen-Hauptmatrixformular. Zum Schreiben von Spaltenhauptdaten muss die XMMATRIX über XMMatrixTranpose transponiert werden, bevor die Speicherfunktion aufgerufen wird.

Diese Funktion übernimmt eine Matrix und schreibt die Komponenten an der angegebenen Adresse in sechzehn Gleitkommawerte mit einer bestimmten Genauigkeit aus. Die wichtigste Komponente des ersten Zeilenvektors wird in die ersten vier Bytes der Adresse geschrieben, gefolgt von der zweitwissigen Komponente der ersten Zeile usw. Die zweite Zeile wird dann in einer ähnlichen Weise wie der Speicher ab Byte 16 geschrieben, gefolgt von der dritten Zeile zum Speicher ab Byte 32 und schließlich die vierte Zeile zum Speicher ab Byte 48.

Der folgende Pseudocode veranschaulicht den Betrieb der Funktion.

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

Plattformanforderungen

Microsoft Visual Studio 2010 oder Microsoft Visual Studio 2012 mit dem Windows SDK für Windows 8. Unterstützt für Win32-Desktop-Apps, Windows Store-Apps und Windows Phone 8-Apps.

Anforderungen

Anforderung Wert
Zielplattform Windows
Kopfzeile directxmath.h

Weitere Informationen

Vektorspeicherfunktionen der DirectXMath-Bibliothek