XMLoadUDecN4

Loads an XMUDECN4 into an XMVECTOR.

Syntax

XMVECTOR XMLoadUDecN4(
         const XMUDECN4 *pSource
)  

Parameters

pSource
Type: XMUDECN4 *

[in]

Address of the XMUDECN4 structure to load.

Return value

Type: XMVECTOR 

Returns an XMVECTOR loaded with the data from the pSource parameter.

Remarks

The following pseudocode demonstrates the operation of the function.

      XMVECTOR vectorOut;

      uint32_t Element;

      Element = pSource->v & 0x3FF;
      vectorOut.x = (float)Element / 1023.f;
      Element = (pSource->v >> 10) & 0x3FF;
      vectorOut.y = (float)Element / 1023.f;
      Element = (pSource->v >> 20) & 0x3FF;
      vectorOut.z = (float)Element / 1023.f;
      vectorOut.w = (float)(pSource->v >> 30) / 3.f;

      return vectorOut;  

Requirements

Header: Declared in directxpackedvector.h.