XMStoreShort4 함수(directxpackedvector.h)

XMVECTORXMSHORT4 저장합니다.

구문

void XM_CALLCONV XMStoreShort4(
  [out] XMSHORT4  *pDestination,
  [in]  FXMVECTOR V
) noexcept;

매개 변수

[out] pDestination

데이터를 저장할 주소입니다.

[in] V

저장할 데이터를 포함하는 벡터입니다.

반환 값

없음

설명

이 함수는 벡터를 가져와 -32767.0f에서 32767.0f 범위로 고정하고, 구성 요소를 부가적이고 정규화된 정수 형식으로 변환하고, 결과를 지정된 주소의 짧은 정수 값 4개에 씁니다. 가장 중요한 구성 요소는 주소의 처음 두 바이트에 기록되고, 다음으로 가장 중요한 구성 요소는 주소의 다음 두 바이트에 기록됩니다.

다음 의사 코드는 함수의 작업을 보여 줍니다.

static const XMVECTOR  Min = {-32767.0f, -32767.0f, -32767.0f, -32767.0f};
static const XMVECTOR  Max = {32767.0f, 32767.0f, 32767.0f, 32767.0f};
XMVECTOR               N;
N = XMVectorClamp(V, Min, Max);
N = XMVectorRound(N);

pDestination->x = (int16_t)N.x; // 2 bytes to address pDestination
pDestination->y = (int16_t)N.y; // 2 bytes to address (uint8_t*)pDestination + 2
pDestination->z = (int16_t)N.z; // 2 bytes to address (uint8_t*)pDestination + 4
pDestination->w = (int16_t)N.w; // 2 bytes to address (uint8_t*)pDestination + 6

플랫폼 요구 사항

Windows 8 Windows SDK Microsoft Visual Studio 2010 또는 Microsoft Visual Studio 2012. Win32 데스크톱 앱, Windows 스토어 앱 및 Windows Phone 8개 앱에 지원됩니다.

요구 사항

요구 사항
대상 플랫폼 Windows
헤더 directxpackedvector.h(DirectXPackedVector.h 포함)

추가 정보

DirectXMath 라이브러리 벡터 저장소 함수