XMFLOAT3PK structure (directxpackedvector.h)
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.
For a list of additional functionality, such as constructors and operators, available using
XMFLOAT3PK
when programming in C++, see XMFLOAT3PK Extensions.
Syntax
struct XMFLOAT3PK {
union {
struct {
uint32_t xm : 6;
uint32_t xe : 5;
uint32_t ym : 6;
uint32_t ye : 5;
uint32_t zm : 5;
uint32_t ze : 5;
};
uint32_t v;
};
void XMFLOAT3PK();
void XMFLOAT3PK(
const XMFLOAT3PK & unnamedParam1
);
XMFLOAT3PK & operator=(
const XMFLOAT3PK & unnamedParam1
);
void XMFLOAT3PK(
XMFLOAT3PK && unnamedParam1
);
XMFLOAT3PK & operator=(
XMFLOAT3PK && unnamedParam1
);
void XMFLOAT3PK(
uint32_t Packed
) noexcept;
void XMFLOAT3PK(
float _x,
float _y,
float _z
) noexcept;
void XMFLOAT3PK(
const float *pArray
) noexcept;
void operator uint32_t() noexcept;
XMFLOAT3PK & operator=(
uint32_t Packed
) noexcept;
};
Members
6 xm
The 6-bit mantissa for the x component.
5 xe
The 5-bit biased exponent for the x component.
6 ym
The 6-bit mantissa for the y component.
5 ye
The 5-bit biased exponent for the y component.
5 zm
The 5-bit mantissa for the z component.
5 ze
The 5-bit biased exponent for the z component.
v
Unsigned 32-bit integer representing the 3D vector.
Default constructor for XMFLOAT3PK
.
Default constructor for XMFLOAT3PK.
void XMFLOAT3PK( const XMFLOAT3PK & unnamedParam1)
A constructor for XMFLOAT3PK
.
A constructor for XMFLOAT3PK.
XMFLOAT3PK & operator=( const XMFLOAT3PK & unnamedParam1)
void XMFLOAT3PK( XMFLOAT3PK && unnamedParam1)
Assigns the vector component data from one instance of XMFLOAT3SE
to the current instance of XMFLOAT3SE
.
This operator assigns the vector component data from one instance of XMFLOAT3SE to the current instance of XMFLOAT3SE
.
XMFLOAT3PK & operator=( XMFLOAT3PK && unnamedParam1)
Assigns the vector component data from one instance of XMFLOAT3PK
to the current instance of XMFLOAT3PK
.
This operator assigns the vector component data from one instance of XMFLOAT3PK to the current instance of XMFLOAT3PK
.
void XMFLOAT3PK( uint32_t Packed) noexcept
Initializes a new instance of XMFLOAT3PK
from a uint32_t
variable containing component data in a packed format.
This constructor initializes a new instance of XMFLOAT3PK from a
uint32_t
variable containing component data in a packed format.
void XMFLOAT3PK( float _x, float _y, float _z) noexcept
Initializes a new instance of XMFLOAT3PK
from three float
arguments.
This constructor initializes a new instance of XMFLOAT3PK from three
float
arguments.
void XMFLOAT3PK( const float *pArray) noexcept
Initializes a new instance of XMFLOAT3PK from a three element float
array argument.
This constructor initializes a new instance of XMFLOAT3PK from a three element float
array argument.
void operator uint32_t() noexcept
Returns an instance of uint32_t
containing the components of the
XMFLOAT3PK
instance in a packed format.
This operator returns an instance of uint32_t
containing the components of the
XMFLOAT3PK instance in a packed format.
XMFLOAT3PK & operator=( uint32_t Packed) noexcept
This operator assigns the vector component data packed in an instance of uint32_t
to
the current instance of XMFLOAT3PK.
Remarks
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:
- Bits 0-5 of v are the 6 bit mantissa of the x component's floating point value: the xm member of the structure.
- Bits 6-10 of v are the 5 bit exponent of the x component's floating point value the xe member of the structure.
- Bits 11-16 of v are the 6-bit mantissa of the y component's floating point value: the ym member of the structure.
- Bits 17-21 of v are the 5 bit exponent of the y component's floating point value: the ye member of the structure.
- Bits 22-26 of v are the 5 bit mantissa of the z component's floating point value: the zm member of the structure.
- Bits 27-31 of v are the 5 bit exponent of the z component's floating point value: the ze member of the structure.
XMFLOAT3PK
can be loaded into instances of XMVECTOR by using XMLoadFloat3PK.
Instances of XMVECTOR
can be stored into an instance of XMFLOAT3PK
with XMStoreFloat3PK.
MIN_F10 / MIN_F11 = 6.10352e-5
MAX_F10 = 64512
MAX_F11 = 65024
Namespace: Use DirectX::PackedVector
Platform Requirements
Microsoft Visual Studio 2010 or Microsoft Visual Studio 2012 with the Windows SDK for Windows 8. Supported for Win32 desktop apps, Windows Store apps, and Windows Phone 8 apps.Requirements
Requirement | Value |
---|---|
Header | directxpackedvector.h |