A 4D vector with x-, y-, and z-components represented as 10 bit signed integer values, and the w-component as a 2 bit signed integer value.
If you are programming in C++, you can use the constructors and operator methods of this structure.
Note See DirectXMath Library Type Equivalences for information about equivalent D3DDECLTYPE, D3DFORMAT, and DXGI_FORMAT objects.
struct XMDEC4
The fields in the XMDEC4 structure are declared as follows:
struct XMDEC4
{
union
{
struct
{
int32_t x : 10; // Signed integer value in the range [-511, 511]
// describing the x-coordinate of the vector.
int32_t y : 10; // Signed integer value in the range [-511, 511]
// describing the y-coordinate of the vector.
int32_t z : 10; // Signed integer value in the range [-511, 511]
// describing the z-coordinate of the vector.
int32_t w : 2; // Signed integer value in the range [-1, 1]
// describing the w-coordinate of the vector.
};
uint32_t v; // Unsigned 32-bit integer representing the 4D vector.
};
XMDEC4 can be loaded into instances of XMVECTOR by using XMLoadDec4.
Instances of XMVECTOR can be stored into an instance of XMDEC4 with XMStoreDec4.
Namespace: Use DirectX::PackedVector
Header: Declared in directxpackedvector.h.