XMStoreShortN4-Funktion (directxpackedvector.h)

Speichert einen XMVECTOR in einem XMSHORTN4.

Syntax

void XM_CALLCONV XMStoreShortN4(
  [out] XMSHORTN4 *pDestination,
  [in]  FXMVECTOR V
) noexcept;

Parameter

[out] pDestination

Adresse, an der die Daten gespeichert werden sollen.

[in] V

Vektor mit den zu speichernden Daten.

Rückgabewert

Keine.

Hinweise

Der folgende Pseudocode veranschaulicht den Vorgang der Funktion.

XMVECTOR N;	
static const XMVECTOR  Scale = {32767.0f, 32767.0f, 32767.0f, 32767.0f};

assert(pDestination);

N = XMVectorClamp(V, g_XMNegativeOne, g_XMOne);
N = XMVectorMultiply(N, Scale);
N = XMVectorRound(N);

pDestination->x = (int16_t)N.v[0];
pDestination->y = (int16_t)N.v[1];
pDestination->z = (int16_t)N.v[2];
pDestination->w = (int16_t)N.v[3];

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 directxpackedvector.h (directXPackedVector.h einschließen)

Weitere Informationen

Vektorspeicherfunktionen der DirectXMath-Bibliothek