XMFLOAT3PK Structure

Describes a 3D vector with X and Y components stored as 11-bit floating point number, and Z component stored as a 10-bit floating-point value.

If you are programming in C++, you can use the constructors and operator methods of this structure.

Syntax

struct XMFLOAT3PK  

Remarks

The fields in the XMFLOAT3PK structure are declared as follows:

struct XMFLOAT3PK
{
    union
    {
        struct
        {
            uint32_t xm : 6; // The 6-bit mantissa for the x component. 
            uint32_t xe : 5; // The 5-bit biased exponent for the x component.
            uint32_t ym : 6; // The 6-bit mantissa for the y component.
            uint32_t ye : 5; // The 5-bit biased exponent for the y component.
            uint32_t zm : 5; // The 5-bit mantissa for the z component.
            uint32_t ze : 5; // The 5-bit biased exponent for the z component.
        };
        uint32_t v; // Unsigned 32-bit integer representing the 3D vector.
    };  

There are no sign bits. This means all partial-precision numbers are positive. The z component is stored in the most significant bits, and the x component is stored in the least significant bits like this:

        (Z10Y11X11): [31] ZZZZZzzz zzYYYYYy yyyyyXXX XXxxxxxx [0]  

Or in detail:

XMFLOAT3PK can be loaded into instances of XMVECTOR by using XMLoadFloat3PK.

Instances of XMVECTOR can be stored into an instance of XMFLOAT3PK with XMStoreFloat3PK.

Note the following limits:

MIN_F10 = MIN_F11 = 6.10352e-5  
MAX_F10 = 64512  
MAX_F11 = 65024  

Namespace: Use DirectX::PackedVector

Requirements

Header: Declared in directxpackedvector.h.